summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index f7950da53..e4ff10dad 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -3156,6 +3156,7 @@ glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx)
{
char key[1024];
char *uuid_str = NULL;
+ char *uuid = NULL;
int i;
for (i = 1; i <= count; i++) {
@@ -3166,8 +3167,18 @@ glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx)
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key),
"node-name-%d", i);
- ret = dict_set_str (op_ctx, key,
- uuid_str);
+ uuid = gf_strdup (uuid_str);
+ if (!uuid) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "unable to create dup of"
+ " uuid_str");
+ continue;
+ }
+ ret = dict_set_dynstr (op_ctx, key,
+ uuid);
+ if (ret != 0) {
+ GF_FREE (uuid);
+ }
}
}
}