diff options
author | sin <sin@2f30.org> | 2014-10-10 10:12:01 +0100 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-10-10 10:12:01 +0100 |
commit | 61cd0f8041e36757f4a02aa8894309412e35ccff (patch) | |
tree | 0aedfa1f92d64c1094684c221a1a1dadf5169359 | |
parent | bc2d9e7c11f010e3f2c8ccf6d9a082aafc1a98b8 (diff) | |
download | nnn-61cd0f8041e36757f4a02aa8894309412e35ccff.tar.gz |
Only closedir when dirp is valid
-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; } |