]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/filedir.c
afpd/filedir: fix memory leak
[netatalk.git] / etc / afpd / filedir.c
index 543db0dc0ecdb6710cf30c182234f6942ef50553..5a23f28e4f2e2a631cca759654d138777303f83d 100644 (file)
@@ -582,8 +582,10 @@ char *absupath(const struct vol *vol, struct dir *dir, char *u)
         return NULL;
     if (bcatcstr(path, u) != BSTR_OK)
         return NULL;
-    if (path->slen > MAXPATHLEN)
+    if (path->slen > MAXPATHLEN) {
+        bdestroy(path);
         return NULL;
+    }
 
     LOG(log_debug, logtype_afpd, "absupath: %s", cfrombstr(path));