From 021fac0c945e364d710a6bb5587c056bca47728c Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 12 Sep 2011 11:28:45 +0530 Subject: glusterd: free the allocated string to avoid memleak Change-Id: I690b78032060732c1783e4f9049a114e594a3455 BUG: 3341 Reviewed-on: http://review.gluster.com/179 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 84725982b..bd56daa11 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -772,6 +772,9 @@ glusterd_check_globaloption (char *key) } } + if (completion) + GF_FREE (completion); + for (vmep = glusterd_volopt_map; vmep->key; vmep++) { if (strcmp (vmep->key, key) == 0) { if ((vmep->type == GLOBAL_DOC) || @@ -806,6 +809,9 @@ glusterd_check_localoption (char *key) } } + if (completion) + GF_FREE (completion); + for (vmep = glusterd_volopt_map; vmep->key; vmep++) { if (strcmp (vmep->key, key) == 0) { if ((vmep->type == DOC) || @@ -840,6 +846,9 @@ glusterd_check_voloption (char *key) } } + if (completion) + GF_FREE (completion); + for (vmep = glusterd_volopt_map; vmep->key; vmep++) { if (strcmp (vmep->key, key) == 0) { if ((vmep->type == DOC) || -- cgit