From 741ee573757e77d489d5fe54a0617d7d907486c7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 4 Apr 2026 12:57:49 +0200 Subject: [PATCH] doh: remove superfluous doh_req check It has already been checked previously in the function. Spotted by CodeSonar Closes #21216 --- lib/doh.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/doh.c b/lib/doh.c index cac5a9f0c9..d287093d99 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -254,17 +254,14 @@ static void doh_probe_done(struct Curl_easy *data, dohp->probe_resp[i].result = result; /* We expect either the meta data still to exist or the sub request * to have already failed. */ - DEBUGASSERT(doh_req || result); - if(doh_req) { - if(!result) { - dohp->probe_resp[i].dnstype = doh_req->dnstype; - result = curlx_dyn_addn(&dohp->probe_resp[i].body, - curlx_dyn_ptr(&doh_req->resp_body), - curlx_dyn_len(&doh_req->resp_body)); - curlx_dyn_free(&doh_req->resp_body); - } - Curl_meta_remove(doh, CURL_EZM_DOH_PROBE); + if(!result) { + dohp->probe_resp[i].dnstype = doh_req->dnstype; + result = curlx_dyn_addn(&dohp->probe_resp[i].body, + curlx_dyn_ptr(&doh_req->resp_body), + curlx_dyn_len(&doh_req->resp_body)); + curlx_dyn_free(&doh_req->resp_body); } + Curl_meta_remove(doh, CURL_EZM_DOH_PROBE); if(result) infof(doh, "DoH request %s", curl_easy_strerror(result));