]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
easy: Fixed a memory leak on OOM condition
authorDan Fandrich <dan@coneharvesters.com>
Wed, 19 Feb 2014 07:57:00 +0000 (08:57 +0100)
committerDan Fandrich <dan@coneharvesters.com>
Sat, 22 Feb 2014 14:41:59 +0000 (15:41 +0100)
lib/easy.c

index 2ad42e957ae0824c9169192d42013acddf17c112..c124e25de8358a94709774baaebb9577476cc12c 100644 (file)
@@ -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;
 }