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
This commit is contained in:
Daniel Stenberg 2018-06-24 23:22:35 +02:00
parent 13120f28b3
commit f762fec323
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 12 additions and 15 deletions

View file

@ -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)