From f762fec323f36fd7da7ad6eddfbbae940ec3229e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 24 Jun 2018 23:22:35 +0200 Subject: url: check Curl_conncache_add_conn return code ... it was previously unchecked in two places and thus errors could remain undetected and cause trouble. Closes #2681 --- lib/url.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index f1a6e8db4..27b2c1e14 100644 --- a/lib/url.c +++ b/lib/url.c @@ -4308,7 +4308,9 @@ static CURLcode create_conn(struct Curl_easy *data, conn->data = data; conn->bits.tcpconnect[FIRSTSOCKET] = TRUE; /* we are "connected */ - Curl_conncache_add_conn(data->state.conn_cache, conn); + result = Curl_conncache_add_conn(data->state.conn_cache, conn); + if(result) + goto out; /* * Setup whatever necessary for a resumed transfer @@ -4531,7 +4533,9 @@ static CURLcode create_conn(struct Curl_easy *data, * This is a brand new connection, so let's store it in the connection * cache of ours! */ - Curl_conncache_add_conn(data->state.conn_cache, conn); + result = Curl_conncache_add_conn(data->state.conn_cache, conn); + if(result) + goto out; } #if defined(USE_NTLM) -- cgit v1.2.3