From: Sage Weil Date: Mon, 29 Oct 2012 15:34:58 +0000 (-0700) Subject: os/chain_xattr: do not double memory buffer (again) X-Git-Tag: v0.55~188^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=be438dc8340ef89efcfa8a1b02dbb53c816b3ce1;p=ceph.git os/chain_xattr: do not double memory buffer (again) This appears to be a typo; there is no need to double (again) the size of the buffer we allocate. Signed-off-by: Sage Weil --- diff --git a/src/os/chain_xattr.cc b/src/os/chain_xattr.cc index ea9bcdd202f6..b4d5d005dc88 100644 --- a/src/os/chain_xattr.cc +++ b/src/os/chain_xattr.cc @@ -342,7 +342,7 @@ int chain_listxattr(const char *fn, char *names, size_t len) { return r; size_t total_len = r * 2; // should be enough - char *full_buf = (char *)malloc(total_len * 2); + char *full_buf = (char *)malloc(total_len); if (!full_buf) return -ENOMEM; @@ -387,8 +387,8 @@ int chain_flistxattr(int fd, char *names, size_t len) { if (r < 0) return r; + size_t total_len = r * 2; // should be enough size_t total_len = r * 2; // should be enough - char *full_buf = (char *)malloc(total_len * 2); if (!full_buf) return -ENOMEM;