diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index 1f6930718..8386b44c5 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -3999,13 +3999,40 @@ glusterd_snapshot_create_commit (dict_t *dict, char **op_errstr, gf_log (this->name, GF_LOG_ERROR, "Unable to fetch snap-name"); goto out; } + tmp = gf_strdup (name); + if (!tmp) { + gf_log (this->name, GF_LOG_ERROR, "Out of memory"); + goto out; + } + + ret = dict_set_dynstr (rsp_dict, "snap-name", tmp); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "Unable to set snap-name in rsp_dict"); + GF_FREE (tmp); + goto out; + } } else { ret = dict_get_str (dict, "cg-name", &name); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Unable to fetch cg-name"); goto out; } + tmp = gf_strdup (name); + if (!tmp) { + gf_log (this->name, GF_LOG_ERROR, "Out of memory"); + goto out; + } + + ret = dict_set_str (rsp_dict, "cg-name", tmp); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "Unable to set cg-name in rsp_dict"); + GF_FREE (tmp); + goto out; + } } + tmp = NULL; ret = dict_get_bin (dict, "cg-id", (void **)&cg_id); if (ret) |