]> arthur.barton.de Git - netatalk.git/commitdiff
Fix for adflags
authorFrank Lahm <franklahm@googlemail.com>
Tue, 1 Jan 2013 20:57:58 +0000 (21:57 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 2 Jan 2013 12:39:55 +0000 (13:39 +0100)
etc/afpd/file.c

index 963268febe925cb1c79de57a0f7f93e995717baf..e33b0e3a2b593575cc8467d9975c4e02ebf3ed91 100644 (file)
@@ -604,7 +604,7 @@ int getfilparams(const AFPObj *obj, struct vol *vol, uint16_t bitmap, struct pat
     struct adouble     ad, *adp;
     int                 opened = 0;
     int rc;    
-    int flags;
+    int flags; /* uninitialized ok */
 
     LOG(log_debug, logtype_afpd, "getfilparams(\"%s\")", path->u_name);
 
@@ -640,7 +640,9 @@ int getfilparams(const AFPObj *obj, struct vol *vol, uint16_t bitmap, struct pat
         }
     }
     rc = getmetadata(obj, vol, bitmap, path, dir, buf, buflen, adp);
-    ad_close(adp, ADFLAGS_HF | flags);
+
+    if (opened)
+        ad_close(adp, ADFLAGS_HF | flags);
 
     return( rc );
 }