From 6b59bc180575aebb3fe288b9b0e2e90fa5ea5cb7 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 2 Sep 2011 00:06:19 +0200 Subject: [PATCH] transfer.c: fix loadhostpairs() OOM handling --- lib/transfer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/transfer.c b/lib/transfer.c index 2f4b69cf8..def0e6ade 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 */