mirror of
https://github.com/curl/curl.git
synced 2026-08-26 04:13:31 +03:00
hash: lazy-alloc the table in Curl_hash_add()
This makes Curl_hash_init() infallible which saves error paths. Closes #8132
This commit is contained in:
parent
e43ad4b474
commit
254f7bd78a
10 changed files with 78 additions and 83 deletions
|
|
@ -977,12 +977,12 @@ static void freednsentry(void *freethis)
|
|||
}
|
||||
|
||||
/*
|
||||
* Curl_mk_dnscache() inits a new DNS cache and returns success/failure.
|
||||
* Curl_init_dnscache() inits a new DNS cache.
|
||||
*/
|
||||
int Curl_mk_dnscache(struct Curl_hash *hash)
|
||||
void Curl_init_dnscache(struct Curl_hash *hash)
|
||||
{
|
||||
return Curl_hash_init(hash, 7, Curl_hash_str, Curl_str_key_compare,
|
||||
freednsentry);
|
||||
Curl_hash_init(hash, 7, Curl_hash_str, Curl_str_key_compare,
|
||||
freednsentry);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue