diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-10-28 09:28:05 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-10-30 09:36:21 +0100 |
commit | dcd7e37c3a0ce108635b89cacc1e3425e57bd3bc (patch) | |
tree | 97213435d44104e4217159001944504ce518158d /lib/conncache.c | |
parent | 4011802b35638e311e548e8893fa74373275145a (diff) | |
download | curl-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.c | 8 |
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); } } |