diff options
-rw-r--r-- | noice.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -552,9 +552,11 @@ out: free(dents[i].name); free(dents); - r = closedir(dirp); - if (r == -1) - printerr(1, "closedir"); + if (dirp != NULL) { + r = closedir(dirp); + if (r == -1) + printerr(1, "closedir"); + } goto begin; } |