Skip to contentSkip to conversation

ceph: Fix memory leak in chain_listxattr()

PATCH Superseded Li Wang 1 participant 1 message Oct 30, 2013

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 ceph: Fix memory leak in chain_listxattr()

Free allocated memory before return

---
 src/os/chain_xattr.cc |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
src/os/chain_xattr.cc +3 -1
index 62733e3..0859564 100644
@@ -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)
+  if (r < 0) {
+    goto done;
     return r;
+  }
 
   char *p = full_buf;
   const char *end = full_buf + r;
Signature · 1 line
1.7.9.5