easy_getinfo: check magic, Curl_close safety

Check the easy handles magic in calls to curl_easy_getinfo().
In Curl_close() clear the magic after DNS shutdown since we'd
like to see tracing for this.
When clearing the magic, also clear the verbose flag so we
no longer call DEBUGFUNCTION on such a handle.

Closes #18511
This commit is contained in:
Stefan Eissing 2025-09-10 11:33:36 +02:00 committed by Daniel Stenberg
parent f4758cd524
commit 80ac5fb2ec
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 16 additions and 10 deletions

View file

@ -877,12 +877,16 @@ void curl_easy_cleanup(CURL *ptr)
* information from a performed transfer and similar.
*/
#undef curl_easy_getinfo
CURLcode curl_easy_getinfo(CURL *data, CURLINFO info, ...)
CURLcode curl_easy_getinfo(CURL *easy, CURLINFO info, ...)
{
struct Curl_easy *data = easy;
va_list arg;
void *paramp;
CURLcode result;
if(!GOOD_EASY_HANDLE(data))
return CURLE_BAD_FUNCTION_ARGUMENT;
va_start(arg, info);
paramp = va_arg(arg, void *);