Test: Fix crash if directory doesn't resolve

This commit is contained in:
Vicki Pfau 2020-07-21 01:09:48 -07:00
parent 14e8b12307
commit 1c0aa6c358
1 changed files with 4 additions and 2 deletions

View File

@ -767,8 +767,10 @@ int main(int argc, char** argv) {
}
#ifndef _WIN32
char* rbase = realpath(base, NULL);
strncpy(base, rbase, PATH_MAX);
free(rbase);
if (rbase) {
strncpy(base, rbase, PATH_MAX);
free(rbase);
}
#endif
struct CInemaTestList tests;