summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@kodafritt.se>2014-04-07 20:42:52 +0200
committerSamuel Lidén Borell <samuel@kodafritt.se>2014-04-07 20:42:52 +0200
commit52021c113db6e22bf3bc6f425507cdce94145a27 (patch)
treeee10ed08fe79e83c0349db29bbf1a6b35d114448
parenta915f5e100719efddae34f4b085875c9c3321a31 (diff)
downloadfribid-52021c113db6e22bf3bc6f425507cdce94145a27.tar.gz
fribid-52021c113db6e22bf3bc6f425507cdce94145a27.tar.bz2
fribid-52021c113db6e22bf3bc6f425507cdce94145a27.zip
Don't call closedir() on directories that didn't exist
-rw-r--r--client/posix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/posix.c b/client/posix.c
index 2d4e779..28a82d0 100644
--- a/client/posix.c
+++ b/client/posix.c
@@ -144,7 +144,9 @@ char *platform_currentPath(PlatformDirIter *iter) {
}
void platform_closeDir(PlatformDirIter *iter) {
- closedir(iter->dir);
+ if (iter->dir) {
+ closedir(iter->dir);
+ }
free(iter->path);
free(iter);
}