diff options
author | Bala.FA <barumuga@redhat.com> | 2013-11-21 16:35:40 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-11-21 13:08:16 -0800 |
commit | d13bf457d489559fd8c011533b2201a113243d71 (patch) | |
tree | 944f4b997297b2ab98eaa34d9fa2535f9e567f96 | |
parent | 6157e4198c4ed5782936efd47f39e3e66463a9d2 (diff) |
cli: fix possible memory leaks
BUG: 955548
Change-Id: Iae410712e7e6d7a76cd537c77f1919e3b4cdf6bb
Signed-off-by: Bala.FA <barumuga@redhat.com>
Reviewed-on: http://review.gluster.org/6328
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 3 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 52fa9ecd62c..14f03a9a56a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -3268,6 +3268,9 @@ glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx) uuid = gf_strdup (uuid_str); ret = dict_set_dynstr (op_ctx, key, uuid); + if (ret != 0) { + GF_FREE (uuid); + } } } } diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 5a74b720fc1..e093a566b09 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -4658,8 +4658,10 @@ glusterd_add_brick_to_dict (glusterd_volinfo_t *volinfo, memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "%s.peerid", base_key); ret = dict_set_dynstr (dict, key, peer_id_str); - if (ret) + if (ret) { + GF_FREE (peer_id_str); goto out; + } memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "%s.port", base_key); |