diff options
-rw-r--r-- | libglusterfs/src/common-utils.c | 7 |
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: |