]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/chain_listxattr: fix leak fix
authorSage Weil <sage@inktank.com>
Wed, 30 Oct 2013 20:20:46 +0000 (13:20 -0700)
committerSage Weil <sage@inktank.com>
Fri, 1 Nov 2013 22:58:07 +0000 (15:58 -0700)
e22347df3854a5c5ebc6631c62d70447d67d722d added a bad goto; just free
explicitly instead.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
src/os/chain_xattr.cc

index 52ae8dba868f951f89b4703dd8e6cbdae86a68e5..8ca815689ed36c169719092fd6360799ed267982 100644 (file)
@@ -354,8 +354,10 @@ int chain_listxattr(const char *fn, char *names, size_t len) {
     return -ENOMEM;
 
   r = sys_listxattr(fn, full_buf, total_len);
-  if (r < 0)
-    goto done;
+  if (r < 0) {
+    free(full_buf);
+    return r;
+  }
 
   char *p = full_buf;
   const char *end = full_buf + r;