]> arthur.ath.cx Git - netatalk.git/commitdiff
Fixes, from Riccardo Magliocchetti
authorFrank Lahm <franklahm@googlemail.com>
Mon, 5 Mar 2012 14:24:14 +0000 (15:24 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 5 Mar 2012 14:24:14 +0000 (15:24 +0100)
libatalk/acl/ldap_config.c
libatalk/util/volinfo.c

index da37fb97027638370904806aba70aeef27003061..e0440a6b770514d72543fb0edfffcc1192c02bb2 100644 (file)
@@ -48,10 +48,10 @@ static int getpref(char *buf, char **R_pref, char **R_val)
         val++;
     if ((val = strtok(val, " \n")) == NULL)
         return -1;
-    if ((val = strdup(val)) == NULL)
-        return -1;
     if ((pref = strtok(p, " =")) == NULL)
         return -1;
+    if ((val = strdup(val)) == NULL)
+        return -1;
 
     *R_pref = pref;
     *R_val = val;
index c6cb1f21b454b1045e13ae5abe87608e337388ff..671f57f27816957b72b7ff392becb7d9827f06b1 100644 (file)
@@ -521,6 +521,7 @@ int savevolinfo(const struct vol *vol, const char *Cnid_srv, const char *Cnid_po
     lock.l_type   = F_WRLCK;
 
     if (fcntl(fd, F_SETLK, &lock) < 0) {
+        close(fd);
         if (errno == EACCES || errno == EAGAIN) {
             /* ignore, other process already writing the file */
             return 0;