aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2015-05-24 11:19:07 +0200
committerDan Fandrich <dan@coneharvesters.com>2015-05-24 11:19:07 +0200
commitb6e3da5f081bfae655939dcf4e657eb31dfe2444 (patch)
treeac34cd77bbe9692bc834d30abb5f8c7edf180832 /lib
parent28cdc0d82c6159addc6d2a66449bc6bd2ef0bb71 (diff)
conncache: fixed memory leak on OOM (torture tests)
Diffstat (limited to 'lib')
-rw-r--r--lib/conncache.c4
1 files changed, 3 insertions, 1 deletions
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);