summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 868dab736b9..5c8a8105d30 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -63,13 +63,23 @@
int32_t
afr_set_dict_gfid (dict_t *dict, uuid_t gfid)
{
- int ret = 0;
+ int ret = 0;
+ uuid_t *pgfid = NULL;
GF_ASSERT (gfid);
+ pgfid = GF_CALLOC (1, sizeof (uuid_t), gf_common_mt_char);
+ if (!pgfid) {
+ ret = -1;
+ goto out;
+ }
+ uuid_copy (*pgfid, gfid);
- ret = dict_set_static_bin (dict, "gfid-req", gfid, 16);
+ ret = dict_set_dynptr (dict, "gfid-req", pgfid, 16);
if (ret)
gf_log (THIS->name, GF_LOG_DEBUG, "gfid set failed");
+out:
+ if (ret && pgfid)
+ GF_FREE (pgfid);
return ret;
}