summaryrefslogtreecommitdiff
path: root/networking/nslookup.c
diff options
context:
space:
mode:
authorVitaly Magerya2011-03-22 20:14:26 +0100
committerDenys Vlasenko2011-03-22 20:14:26 +0100
commit7f4b769c42f3773ff2e2e749547291dcb7e85d01 (patch)
tree33680f1d1a6d182c2d78dd2158ee696528fea920 /networking/nslookup.c
parentcf9074b54bfb5a325ce59127b7afe1e892223a1c (diff)
downloadbusybox-7f4b769c42f3773ff2e2e749547291dcb7e85d01.zip
busybox-7f4b769c42f3773ff2e2e749547291dcb7e85d01.tar.gz
don't call freeaddinfo(NULL)
Signed-off-by: Vitaly Magerya <vmagerya@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/nslookup.c')
-rw-r--r--networking/nslookup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/nslookup.c b/networking/nslookup.c
index dcac737..67fc015 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -66,7 +66,7 @@ static int print_host(const char *hostname, const char *header)
// hint.ai_flags = AI_CANONNAME;
rc = getaddrinfo(hostname, NULL /*service*/, &hint, &result);
- if (!rc) {
+ if (rc == 0) {
struct addrinfo *cur = result;
unsigned cnt = 0;
@@ -94,7 +94,7 @@ static int print_host(const char *hostname, const char *header)
bb_error_msg("can't resolve '%s'", hostname);
#endif
}
- if (ENABLE_FEATURE_CLEAN_UP)
+ if (ENABLE_FEATURE_CLEAN_UP && result)
freeaddrinfo(result);
return (rc != 0);
}