diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-05-14 14:06:44 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-05-14 14:06:44 +0200 |
commit | 750d678c0e00583b4f15ee8065a4aa9f6953c46e (patch) | |
tree | c311bd27ac25c4776d2fdff9236d0164a29f4d39 | |
parent | a6af3df660ce88ae52659151f876cf3ea6ddf53f (diff) |
Curl_conncache_add_conn: fix memory leak on OOM
-rw-r--r-- | lib/conncache.c | 4 |
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); |