From 8e25d1b93b590afb923f033810ae52fe88db3b16 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 2 Jan 2012 13:41:09 +0100 Subject: hostip.c: fix Curl_loadhostpairs() OOM handling --- lib/hostip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/hostip.c b/lib/hostip.c index 0d737f406..828d27e42 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); -- cgit v1.2.3