summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2013-12-16 23:37:27 +0530
committerVijay Bellur <vbellur@redhat.com>2013-12-16 23:15:45 -0800
commit1832dbf0ba3d5153415c7e7f7eab935007cc8209 (patch)
tree63c910430827ebd2a0270787a04d57903e55ecbe
parent046cb49f20476ed900ae6dbe6f6ab7fad53d71a9 (diff)
mgmt/glusterd: Fix a memory leak in glusterd_is_local_addr()v3.4.2qa4
Change-Id: Id41d828e1cc56005f5e2a1e75b6d858703dd79c9 BUG: 1032122 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/6518 Reviewed-by: Lukáš Bezdička <lukas.bezdicka@gooddata.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 282dde0..c336337 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -189,7 +189,7 @@ get_ip_from_addrinfo (struct addrinfo *addr, char **ip)
return NULL;
}
- *ip = strdup (buf);
+ *ip = gf_strdup (buf);
return *ip;
}
@@ -291,8 +291,11 @@ glusterd_is_local_addr (char *hostname)
found = glusterd_is_loopback_localhost (res->ai_addr, hostname)
|| glusterd_interface_search (ip);
- if (found)
+ if (found) {
+ GF_FREE (ip);
goto out;
+ }
+ GF_FREE (ip);
}
out: