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
This commit is contained in:
Daniel Stenberg 2019-10-28 09:28:05 +01:00
parent 4011802b35
commit dcd7e37c3a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 25 additions and 31 deletions

View file

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