diff options
author | Vitaly Magerya <vmagerya@gmail.com> | 2011-03-22 20:14:26 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-22 20:14:26 +0100 |
commit | 7f4b769c42f3773ff2e2e749547291dcb7e85d01 (patch) | |
tree | 33680f1d1a6d182c2d78dd2158ee696528fea920 /libbb/xconnect.c | |
parent | cf9074b54bfb5a325ce59127b7afe1e892223a1c (diff) | |
download | busybox-w32-7f4b769c42f3773ff2e2e749547291dcb7e85d01.tar.gz busybox-w32-7f4b769c42f3773ff2e2e749547291dcb7e85d01.tar.bz2 busybox-w32-7f4b769c42f3773ff2e2e749547291dcb7e85d01.zip |
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 'libbb/xconnect.c')
-rw-r--r-- | libbb/xconnect.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/xconnect.c b/libbb/xconnect.c index 3a6585caa..127e2a5fc 100644 --- a/libbb/xconnect.c +++ b/libbb/xconnect.c | |||
@@ -255,7 +255,7 @@ IF_NOT_FEATURE_IPV6(sa_family_t af = AF_INET;) | |||
255 | 255 | ||
256 | memset(&hint, 0 , sizeof(hint)); | 256 | memset(&hint, 0 , sizeof(hint)); |
257 | hint.ai_family = af; | 257 | hint.ai_family = af; |
258 | /* Needed. Or else we will get each address thrice (or more) | 258 | /* Need SOCK_STREAM, or else we get each address thrice (or more) |
259 | * for each possible socket type (tcp,udp,raw...): */ | 259 | * for each possible socket type (tcp,udp,raw...): */ |
260 | hint.ai_socktype = SOCK_STREAM; | 260 | hint.ai_socktype = SOCK_STREAM; |
261 | hint.ai_flags = ai_flags & ~DIE_ON_ERROR; | 261 | hint.ai_flags = ai_flags & ~DIE_ON_ERROR; |
@@ -285,7 +285,8 @@ IF_NOT_FEATURE_IPV6(sa_family_t af = AF_INET;) | |||
285 | set_port: | 285 | set_port: |
286 | set_nport(r, htons(port)); | 286 | set_nport(r, htons(port)); |
287 | ret: | 287 | ret: |
288 | freeaddrinfo(result); | 288 | if (result) |
289 | freeaddrinfo(result); | ||
289 | return r; | 290 | return r; |
290 | } | 291 | } |
291 | #if !ENABLE_FEATURE_IPV6 | 292 | #if !ENABLE_FEATURE_IPV6 |