]> arthur.barton.de Git - netatalk.git/commitdiff
Fix fd leak
authorFrank Lahm <franklahm@googlemail.com>
Wed, 27 Oct 2010 10:24:49 +0000 (12:24 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 27 Oct 2010 10:24:49 +0000 (12:24 +0200)
bin/ad/ad_util.c

index f641a97cc63c133860a7084b5917dc455758fcb0..518867e03bd8aab9ffe4a22bf11e8cdcfe1a1c6c 100644 (file)
@@ -246,8 +246,10 @@ static bstring rel_path_in_vol(const char *path, const char *volpath)
 
 EC_CLEANUP:
     if (dname) free(dname);
-    if (cwd != -1)
+    if (cwd != -1) {
         fchdir(cwd);
+        close(cwd);
+    }
     if (ret != 0)
         return NULL;
     return fpath;