From: Yang Tse Date: Mon, 2 Jan 2012 12:41:09 +0000 (+0100) Subject: hostip.c: fix Curl_loadhostpairs() OOM handling X-Git-Tag: curl-7_24_0~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e25d1b93b590afb923f033810ae52fe88db3b16;p=thirdparty%2Fcurl.git hostip.c: fix Curl_loadhostpairs() OOM handling --- diff --git a/lib/hostip.c b/lib/hostip.c index 0d737f4060..828d27e42b 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -782,8 +782,10 @@ CURLcode Curl_loadhostpairs(struct SessionHandle *data) /* Create an entry id, based upon the hostname and port */ entry_id = create_hostcache_id(hostname, port); /* If we can't create the entry id, fail */ - if(!entry_id) + if(!entry_id) { + Curl_freeaddrinfo(addr); return CURLE_OUT_OF_MEMORY; + } entry_len = strlen(entry_id);