From 2fe405c808fdbc9109bced9ec52be9d79ca321e7 Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Tue, 21 Jan 2014 20:42:22 -0500 Subject: 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 Reviewed-on: http://review.gluster.org/6754 Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System --- xlators/mgmt/glusterd/src/glusterd-store.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index d0ad7dcdb..2c2fc6fb4 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); -- cgit