From: Yang Tse Date: Thu, 1 Sep 2011 22:06:19 +0000 (+0200) Subject: transfer.c: fix loadhostpairs() OOM handling X-Git-Tag: curl-7_22_0~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b59bc180575aebb3fe288b9b0e2e90fa5ea5cb7;p=thirdparty%2Fcurl.git transfer.c: fix loadhostpairs() OOM handling --- diff --git a/lib/transfer.c b/lib/transfer.c index 2f4b69cf81..def0e6ade9 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1437,8 +1437,10 @@ static CURLcode loadhostpairs(struct SessionHandle *data) if(data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); - if(!dns) + if(!dns) { + Curl_freeaddrinfo(addr); return CURLE_OUT_OF_MEMORY; + } } } data->change.resolve = NULL; /* dealt with now */