aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-06-24 23:22:35 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-06-25 16:36:10 +0200
commitf762fec323f36fd7da7ad6eddfbbae940ec3229e (patch)
tree8d5ee8297c94124062f1d5b0fd239c87e44456ca /lib/url.c
parent13120f28b309e6276690383b2daa977ec9aa99c8 (diff)
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
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c8
1 files changed, 6 insertions, 2 deletions
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)