From b6e3da5f081bfae655939dcf4e657eb31dfe2444 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Sun, 24 May 2015 11:19:07 +0200 Subject: conncache: fixed memory leak on OOM (torture tests) --- lib/conncache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/conncache.c b/lib/conncache.c index 5c3957519..c712ed7b9 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); -- cgit v1.2.3