From b0003a7e789e0618656dd4214195578f53d1e84e Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 14 Sep 2010 00:54:22 +0000 Subject: mgmt/glusterd: free xdr allocations Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur BUG: 1186 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1186 --- xlators/mgmt/glusterd/src/glusterd3_1-mops.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd3_1-mops.c') diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c index eb752a665fd..f9083852e1a 100644 --- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c +++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c @@ -121,9 +121,13 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov, gf_log ("glusterd", GF_LOG_NORMAL, "Received resp to probe req"); + if (rsp.hostname) + free (rsp.hostname);//malloced by xdr return ret; out: + if (rsp.hostname) + free (rsp.hostname);//malloced by xdr return ret; } @@ -216,6 +220,8 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov, if (ctx) glusterd_destroy_probe_ctx (ctx); out: + if (rsp.hostname) + free (rsp.hostname);//malloced by xdr return ret; } @@ -308,6 +314,8 @@ respond: if (ctx) glusterd_destroy_probe_ctx (ctx); + if (rsp.hostname) + free (rsp.hostname);//malloced by xdr return ret; } @@ -850,7 +858,7 @@ glusterd3_1_friend_update (call_frame_t *frame, xlator_t *this, uuid_unparse (peerinfo->uuid, uuid_buf); snprintf (key, sizeof (key), "friend%d.uuid", count); dup_buf = gf_strdup (uuid_buf); - ret = dict_set_str (friends, key, dup_buf); + ret = dict_set_dynstr (friends, key, dup_buf); if (ret) goto out; snprintf (key, sizeof (key), "friend%d.hostname", count); -- cgit