Curl_conncache_add_conn: fix memory leak on OOM
This commit is contained in:
parent
a6af3df660
commit
750d678c0e
@ -205,8 +205,10 @@ CURLcode Curl_conncache_add_conn(struct conncache *connc,
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
key = hashkey(conn);
|
key = hashkey(conn);
|
||||||
if(!key)
|
if(!key) {
|
||||||
|
bundle_destroy(new_bundle);
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
rc = conncache_add_bundle(data->state.conn_cache, key, new_bundle);
|
rc = conncache_add_bundle(data->state.conn_cache, key, new_bundle);
|
||||||
free(key);
|
free(key);
|
||||||
|
Loading…
Reference in New Issue
Block a user