+ when storing the address in the cache fails, cleanup the resolved address

properly
+ delete trailing whitespace
This commit is contained in:
Daniel Stenberg 2004-05-18 07:35:37 +00:00
parent 2511d1193a
commit 17eb1fca7c
1 changed files with 8 additions and 5 deletions

View File

@ -136,6 +136,9 @@ void Curl_addrinfo_callback(void *arg, /* "struct connectdata *" */
dns = Curl_cache_addr(data, he,
conn->async.hostname,
conn->async.port);
if(!dns)
/* failed to store, cleanup and return error */
Curl_freeaddrinfo(he);
if(data->share)
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);