mirror of
https://github.com/curl/curl.git
synced 2026-08-26 22:34:45 +03:00
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:
parent
4011802b35
commit
dcd7e37c3a
7 changed files with 25 additions and 31 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue