aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/librdns/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/librdns/util.c')
-rw-r--r--contrib/librdns/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/librdns/util.c b/contrib/librdns/util.c
index 920e94b99..be31c8f14 100644
--- a/contrib/librdns/util.c
+++ b/contrib/librdns/util.c
@@ -207,7 +207,7 @@ rdns_make_client_socket (const char *credits,
hints.ai_flags |= AI_NUMERICHOST | AI_NUMERICSERV;
snprintf (portbuf, sizeof (portbuf), "%d", (int)port);
- if ((r = getaddrinfo (credits, portbuf, &hints, &res)) == 0) {
+ if (getaddrinfo (credits, portbuf, &hints, &res) == 0) {
r = rdns_make_inet_socket (type, res, psockaddr, psocklen);
if (r != -1 && psockaddr) {
@@ -217,6 +217,7 @@ rdns_make_client_socket (const char *credits,
if (cpy == NULL) {
close (r);
+ freeaddrinfo (res);
return -1;
}