From: Dan Fandrich Date: Sun, 24 May 2015 09:19:07 +0000 (+0200) Subject: conncache: fixed memory leak on OOM (torture tests) X-Git-Tag: curl-7_43_0~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6e3da5f081bfae655939dcf4e657eb31dfe2444;p=thirdparty%2Fcurl.git conncache: fixed memory leak on OOM (torture tests) --- diff --git a/lib/conncache.c b/lib/conncache.c index 5c39575192..c712ed7b95 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -205,8 +205,10 @@ CURLcode Curl_conncache_add_conn(struct conncache *connc, return result; key = hashkey(conn); - if(!key) + if(!key) { + bundle_destroy(new_bundle); return CURLE_OUT_OF_MEMORY; + } rc = conncache_add_bundle(data->state.conn_cache, key, new_bundle); free(key);