]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: Fix memory leak in chain_listxattr
authorLi Wang <liwang@ubuntukylin.com>
Wed, 30 Oct 2013 08:39:09 +0000 (16:39 +0800)
committerSage Weil <sage@inktank.com>
Wed, 30 Oct 2013 16:02:58 +0000 (09:02 -0700)
Free allocated memory before return

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/os/chain_xattr.cc

index 62733e390d364c5c8a9b5cc52a7d9d524b13a7f3..52ae8dba868f951f89b4703dd8e6cbdae86a68e5 100644 (file)
@@ -355,7 +355,7 @@ int chain_listxattr(const char *fn, char *names, size_t len) {
 
   r = sys_listxattr(fn, full_buf, total_len);
   if (r < 0)
-    return r;
+    goto done;
 
   char *p = full_buf;
   const char *end = full_buf + r;