Commit 750d678c authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Curl_conncache_add_conn: fix memory leak on OOM

parent a6af3df6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);