aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-05-14 14:06:44 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-05-14 14:06:44 +0200
commit750d678c0e00583b4f15ee8065a4aa9f6953c46e (patch)
treec311bd27ac25c4776d2fdff9236d0164a29f4d39
parenta6af3df660ce88ae52659151f876cf3ea6ddf53f (diff)
Curl_conncache_add_conn: fix memory leak on OOM
-rw-r--r--lib/conncache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/conncache.c b/lib/conncache.c
index 68d9c44df..5496f097c 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);