From: Dan Fandrich Date: Wed, 19 Feb 2014 07:57:00 +0000 (+0100) Subject: easy: Fixed a memory leak on OOM condition X-Git-Tag: curl-7_36_0~113 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a660c0dbe6a81317c64d6652ddc66658e2752d2e;p=thirdparty%2Fcurl.git easy: Fixed a memory leak on OOM condition --- diff --git a/lib/easy.c b/lib/easy.c index 2ad42e957a..c124e25de8 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -715,6 +715,15 @@ static CURLcode easy_transfer(CURLM *multi) } } } + + /* Make sure to return some kind of error if there was a multi problem */ + if(mcode) { + return (mcode == CURLM_OUT_OF_MEMORY) ? CURLE_OUT_OF_MEMORY : + /* The other multi errors should never happen, so return + something suitably generic */ + CURLE_BAD_FUNCTION_ARGUMENT; + } + return code; }