summaryrefslogtreecommitdiff
path: root/lib/hostasyn.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-18 07:35:37 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-18 07:35:37 +0000
commit17eb1fca7c4062db6a836291aec7fc925e4e7c8b (patch)
treee2cf91990ca007469e0f36bea0af2e0ad8a3d61c /lib/hostasyn.c
parent2511d1193ac5ec176ca9ee5e583164979eacc90b (diff)
downloadcurl-17eb1fca7c4062db6a836291aec7fc925e4e7c8b.tar.gz
+ when storing the address in the cache fails, cleanup the resolved address
properly + delete trailing whitespace
Diffstat (limited to 'lib/hostasyn.c')
-rw-r--r--lib/hostasyn.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/hostasyn.c b/lib/hostasyn.c
index 1c22c53e2..d308cd17d 100644
--- a/lib/hostasyn.c
+++ b/lib/hostasyn.c
@@ -1,8 +1,8 @@
/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
@@ -10,7 +10,7 @@
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
- *
+ *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING 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);