summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-handshake.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-08-31 12:52:34 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-08-31 11:31:23 -0700
commit70652df2f7780aa734119941ac54d88ae6de7ae9 (patch)
tree96928b36d2412c211846e52d73dd2b3fb45b420f /xlators/mgmt/glusterd/src/glusterd-handshake.c
parente7cbae70c89c8813918d9deb3895cb6886cdaeeb (diff)
mgmt/glusterd: memory leak fixes
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1186 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1186
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handshake.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handshake.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c
index 95fe96e04..1ea1fcef0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handshake.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c
@@ -47,11 +47,13 @@ build_volfile_path (const char *volname, char *path,
glusterd_conf_t *priv = NULL;
char *vol = NULL;
char *dup_volname = NULL;
+ char *free_ptr = NULL;
char *tmp = NULL;
glusterd_volinfo_t *volinfo = NULL;
priv = THIS->private;
dup_volname = gf_strdup (volname);
+ free_ptr = dup_volname;
ret = glusterd_volinfo_find (dup_volname, &volinfo);
if (ret) {
@@ -81,9 +83,8 @@ build_volfile_path (const char *volname, char *path,
ret = 1;
out:
- if (dup_volname)
- GF_FREE (dup_volname);
-
+ if (free_ptr)
+ GF_FREE (free_ptr);
return ret;
}