From 59e351a572956fb99a1c1950b9b309cff5f16fc6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 2 May 2020 16:59:38 +0200 Subject: asyn-*: remove support for never-used NULL entry pointers ... and instead convert those to asserts to make sure they are truly never NULL. Closes #5324 --- lib/asyn-thread.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/asyn-thread.c') diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index 6f63ce833..2138eb5cf 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -509,6 +509,9 @@ static CURLcode resolver_error(struct connectdata *conn) return result; } +/* + * 'entry' may be NULL and then no data is returned + */ static CURLcode thread_wait_resolv(struct connectdata *conn, struct Curl_dns_entry **entry, bool report) @@ -593,8 +596,8 @@ CURLcode Curl_resolver_is_resolved(struct connectdata *conn, struct thread_data *td = (struct thread_data*) conn->async.os_specific; int done = 0; - if(entry) - *entry = NULL; + DEBUGASSERT(entry); + *entry = NULL; if(!td) { DEBUGASSERT(td); @@ -614,8 +617,7 @@ CURLcode Curl_resolver_is_resolved(struct connectdata *conn, return result; } destroy_async_data(&conn->async); - if(entry) - *entry = conn->async.dns; + *entry = conn->async.dns; } else { /* poll for name lookup done with exponential backoff up to 250ms */ -- cgit v1.2.3