summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/dht/src/dht-common.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index fbe18959a43..4d8d326ec25 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1728,13 +1728,14 @@ dht_vgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (local->xattr_val) {
plen = strlen (local->xattr_val);
if (plen) {
+ void *p;
/* extra byte(s) for \0 to be safe */
alloc_len += (plen + 2);
- local->xattr_val =
- GF_REALLOC (local->xattr_val,
- alloc_len);
- if (!local->xattr_val)
+ p = GF_REALLOC (local->xattr_val,
+ alloc_len);
+ if (!p)
goto out;
+ local->xattr_val = p;
}
strcat (local->xattr_val, value_got);