mirror of
https://github.com/curl/curl.git
synced 2026-08-26 05:23:33 +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
|
|
@ -39,11 +39,7 @@ curl_share_init(void)
|
|||
if(share) {
|
||||
share->magic = CURL_GOOD_SHARE;
|
||||
share->specifier |= (1<<CURL_LOCK_DATA_SHARE);
|
||||
|
||||
if(Curl_mk_dnscache(&share->hostcache)) {
|
||||
free(share);
|
||||
return NULL;
|
||||
}
|
||||
Curl_init_dnscache(&share->hostcache);
|
||||
}
|
||||
|
||||
return share;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue