Only closedir when dirp is valid

This commit is contained in:
sin 2014-10-10 10:12:01 +01:00
parent bc2d9e7c11
commit 61cd0f8041

View file

@ -552,9 +552,11 @@ out:
free(dents[i].name);
free(dents);
if (dirp != NULL) {
r = closedir(dirp);
if (r == -1)
printerr(1, "closedir");
}
goto begin;
}