From 39dd3b21c59380fb5f4dcae59ebd4f8e000cfa98 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Thu, 5 Dec 2013 12:31:34 +0530 Subject: libglusterfs: Free IP address string in gf_is_local_addr() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib113de269134c907aa2f35459e2764c142b94477 BUG: 1032122 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/6433 Tested-by: Lukáš Bezdička Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/common-utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 7862f6aa0..1dfb418e4 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -2725,7 +2725,7 @@ get_ip_from_addrinfo (struct addrinfo *addr, char **ip) return NULL; } - *ip = strdup (buf); + *ip = gf_strdup (buf); return *ip; } @@ -2791,8 +2791,11 @@ gf_is_local_addr (char *hostname) found = gf_is_loopback_localhost (res->ai_addr, hostname) || gf_interface_search (ip); - if (found) + if (found) { + GF_FREE (ip); goto out; + } + GF_FREE (ip); } out: -- cgit