diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-09-12 08:59:00 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-09-12 08:59:00 +0000 |
commit | 36e9507e294b28aa90d93d8c501b563745a3af7e (patch) | |
tree | 8d067b19d05d68fa8548cdb533bc089970f6b58b /lib/hostip.c | |
parent | 1fde1431c9d857c3ae8482bb596dab8ec0bd9a48 (diff) | |
download | curl-36e9507e294b28aa90d93d8c501b563745a3af7e.tar.gz |
reverted. twas no memory leak and the "fix" didn't even compile on windows...
Diffstat (limited to 'lib/hostip.c')
-rw-r--r-- | lib/hostip.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/hostip.c b/lib/hostip.c index be365d45f..8526fb91c 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -125,8 +125,6 @@ struct hostent *Curl_gethost(struct SessionHandle *data, { struct hostent *h = NULL; unsigned long in; - -#ifdef HAVE_GETHOSTBYNAME_R int ret; /* this variable is unused on several platforms but used on some */ #define CURL_NAMELOOKUP_SIZE 9000 @@ -138,7 +136,7 @@ struct hostent *Curl_gethost(struct SessionHandle *data, if(!buf) return NULL; /* major failure */ *bufp = buf; -#endif + ret = 0; /* to prevent the compiler warning */ if ( (in=inet_addr(hostname)) != INADDR_NONE ) { @@ -208,9 +206,10 @@ struct hostent *Curl_gethost(struct SessionHandle *data, } #else else { - *bufp=NULL; /* zero this always */ if ((h = gethostbyname(hostname)) == NULL ) { infof(data, "gethostbyname(2) failed for %s\n", hostname); + free(buf); + *bufp=NULL; } #endif } |