From a660c0dbe6a81317c64d6652ddc66658e2752d2e Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 19 Feb 2014 08:57:00 +0100 Subject: easy: Fixed a memory leak on OOM condition --- lib/easy.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/easy.c') diff --git a/lib/easy.c b/lib/easy.c index 2ad42e957..c124e25de 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; } -- cgit v1.2.3