From: Li Wang Date: Wed, 30 Oct 2013 08:39:09 +0000 (+0800) Subject: ceph: Fix memory leak in chain_listxattr X-Git-Tag: v0.72~29^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e22347df3854a5c5ebc6631c62d70447d67d722d;p=ceph.git ceph: Fix memory leak in chain_listxattr Free allocated memory before return Signed-off-by: Li Wang Reviewed-by: Sage Weil --- diff --git a/src/os/chain_xattr.cc b/src/os/chain_xattr.cc index 62733e390d36..52ae8dba868f 100644 --- a/src/os/chain_xattr.cc +++ b/src/os/chain_xattr.cc @@ -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;