summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorIra Cooper <ira@samba.org>2014-01-21 20:42:22 -0500
committerVijay Bellur <vbellur@redhat.com>2014-01-22 06:09:34 -0800
commit2fe405c808fdbc9109bced9ec52be9d79ca321e7 (patch)
tree5751610aa56b70d828903ce5147bd468903e9570 /xlators/mgmt/glusterd/src
parentfdc82748a1d1f063e3c11c840e6ec54ddf0fe0e1 (diff)
glusterd: Fix memory leak of hostname.
The if causes a goto that allows the GF_FREE to be missed. BUG: 789278 Change-Id: Ic2c20b7623ea880b8ab2d11ebe510a62633a036d CID: 1124785 Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-on: http://review.gluster.org/6754 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index d0ad7dc..2c2fc6f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -2582,8 +2582,10 @@ glusterd_store_retrieve_peers (xlator_t *this)
ret = gf_store_iter_get_next (iter, &key, &value,
&op_errno);
}
- if (op_errno != GD_STORE_EOF)
+ if (op_errno != GD_STORE_EOF) {
+ GF_FREE(hostname);
goto out;
+ }
(void) gf_store_iter_destroy (iter);