aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2014-02-19 08:57:00 +0100
committerDan Fandrich <dan@coneharvesters.com>2014-02-22 15:41:59 +0100
commita660c0dbe6a81317c64d6652ddc66658e2752d2e (patch)
treedee558050636e3e2bc27253517b66afbfbf481c8
parent3521e4e40d5a68c239a0248a0b472131b2dee5c2 (diff)
easy: Fixed a memory leak on OOM condition
-rw-r--r--lib/easy.c9
1 files changed, 9 insertions, 0 deletions
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;
}