aboutsummaryrefslogtreecommitdiff
path: root/lib/hostasyn.c
diff options
context:
space:
mode:
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);