summaryrefslogtreecommitdiff
path: root/lib/conncache.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-10-28 09:28:05 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-10-30 09:36:21 +0100
commitdcd7e37c3a0ce108635b89cacc1e3425e57bd3bc (patch)
tree97213435d44104e4217159001944504ce518158d /lib/conncache.c
parent4011802b35638e311e548e8893fa74373275145a (diff)
downloadcurl-dcd7e37c3a0ce108635b89cacc1e3425e57bd3bc.tar.gz
url: make Curl_close() NULLify the pointer too
This is the common pattern used in the code and by a unified approach we avoid mistakes. Closes #4534
Diffstat (limited to 'lib/conncache.c')
-rw-r--r--lib/conncache.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/conncache.c b/lib/conncache.c
index 2f4dd4bc3..57d6061fd 100644
--- a/lib/conncache.c
+++ b/lib/conncache.c
@@ -143,10 +143,8 @@ int Curl_conncache_init(struct conncache *connc, int size)
rc = Curl_hash_init(&connc->hash, size, Curl_hash_str,
Curl_str_key_compare, free_bundle_hash_entry);
- if(rc) {
- Curl_close(connc->closure_handle);
- connc->closure_handle = NULL;
- }
+ if(rc)
+ Curl_close(&connc->closure_handle);
else
connc->closure_handle->state.conn_cache = connc;
@@ -595,7 +593,7 @@ void Curl_conncache_close_all_connections(struct conncache *connc)
Curl_hostcache_clean(connc->closure_handle,
connc->closure_handle->dns.hostcache);
- Curl_close(connc->closure_handle);
+ Curl_close(&connc->closure_handle);
sigpipe_restore(&pipe_st);
}
}