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 <sage@inktank.com>
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;
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;