From 750d678c0e00583b4f15ee8065a4aa9f6953c46e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 14 May 2015 14:06:44 +0200 Subject: [PATCH] Curl_conncache_add_conn: fix memory leak on OOM --- lib/conncache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/conncache.c b/lib/conncache.c index 68d9c44df3..5496f097c4 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);