]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
+ when storing the address in the cache fails, cleanup the resolved address
authorDaniel Stenberg <daniel@haxx.se>
Tue, 18 May 2004 07:35:37 +0000 (07:35 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 18 May 2004 07:35:37 +0000 (07:35 +0000)
properly
+ delete trailing whitespace

lib/hostasyn.c

index 1c22c53e25963529647f11dd9ac5c39565ca427f..d308cd17d4470f3853372d22402705cecc934cee 100644 (file)
@@ -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);