1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-24 11:46:31 +02:00

Remote: Handle case when dir[hdr.handle] is NULL

This commit is contained in:
Arthur Zakirov 2019-04-23 14:15:02 +03:00
parent 9ea7634e66
commit da6a1126f3

View File

@ -1250,7 +1250,8 @@ void fio_communicate(int in, int out)
}
break;
case FIO_CLOSEDIR: /* Finish directory traversal */
SYS_CHECK(closedir(dir[hdr.handle]));
if (dir[hdr.handle] != NULL)
SYS_CHECK(closedir(dir[hdr.handle]));
break;
case FIO_OPEN: /* Open file */
SYS_CHECK(fd[hdr.handle] = open(buf, hdr.arg, FILE_PERMISSIONS));