summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2013-12-05 12:31:34 +0530
committerAnand Avati <avati@redhat.com>2013-12-05 13:36:18 -0800
commit39dd3b21c59380fb5f4dcae59ebd4f8e000cfa98 (patch)
tree39e3dd7d8cb6c8c2a3df266c9aeb8041ea8df9d6
parent64e3fada97bdb6dc4b885d6122e56eb93273503c (diff)
libglusterfs: Free IP address string in gf_is_local_addr()
Change-Id: Ib113de269134c907aa2f35459e2764c142b94477 BUG: 1032122 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/6433 Tested-by: Lukáš Bezdička <lukas.bezdicka@gooddata.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--libglusterfs/src/common-utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 7862f6aa01b..1dfb418e4a8 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: