From 7f4b769c42f3773ff2e2e749547291dcb7e85d01 Mon Sep 17 00:00:00 2001 From: Vitaly Magerya Date: Tue, 22 Mar 2011 20:14:26 +0100 Subject: don't call freeaddinfo(NULL) Signed-off-by: Vitaly Magerya Signed-off-by: Denys Vlasenko --- networking/nslookup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'networking') diff --git a/networking/nslookup.c b/networking/nslookup.c index dcac7379e..67fc01547 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); } -- cgit v1.2.3