From 254f7bd78a1ab248329def2cbbbc983e7f6d2495 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 10 Dec 2021 12:54:17 +0100 Subject: hash: lazy-alloc the table in Curl_hash_add() This makes Curl_hash_init() infallible which saves error paths. Closes #8132 --- lib/share.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/share.c') diff --git a/lib/share.c b/lib/share.c index 9c43c8f70..403563fdd 100644 --- a/lib/share.c +++ b/lib/share.c @@ -39,11 +39,7 @@ curl_share_init(void) if(share) { share->magic = CURL_GOOD_SHARE; share->specifier |= (1<hostcache)) { - free(share); - return NULL; - } + Curl_init_dnscache(&share->hostcache); } return share; -- cgit v1.2.1