summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-common.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 9b8807f63d7..3ccb89eccdd 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1712,9 +1712,10 @@ dht_pathinfo_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
* allocate the buffer:- we allocate 10 bytes extra in case we need to
* append ' Link: ' in the buffer for another STACK_WIND
*/
- if (!local->pathinfo)
- local->pathinfo = GF_CALLOC (alloc_len + strlen (DHT_PATHINFO_HEADER) + 10,
- sizeof (char), gf_common_mt_char);
+ if (!local->pathinfo) {
+ alloc_len += (strlen (DHT_PATHINFO_HEADER) + 10);
+ local->pathinfo = GF_CALLOC (alloc_len, sizeof (char), gf_common_mt_char);
+ }
if (local->pathinfo) {
plen = strlen (local->pathinfo);