]> granicus.if.org Git - curl/commitdiff
conncache: fixed memory leak on OOM (torture tests)
authorDan Fandrich <dan@coneharvesters.com>
Sun, 24 May 2015 09:19:07 +0000 (11:19 +0200)
committerDan Fandrich <dan@coneharvesters.com>
Sun, 24 May 2015 09:19:07 +0000 (11:19 +0200)
lib/conncache.c

index 5c3957519237aed4a0cc585e033251b679593dd5..c712ed7b950a91f0b403ef52b24d4e3e085f7aea 100644 (file)
@@ -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);