From 17eb1fca7c4062db6a836291aec7fc925e4e7c8b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 May 2004 07:35:37 +0000 Subject: [PATCH] + when storing the address in the cache fails, cleanup the resolved address properly + delete trailing whitespace --- lib/hostasyn.c | 13 ++++++++----- 1 file 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, , 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);