tidy-up: rename Curl_safefree()/tool_safefree() to curlx_safefree()

To sync names for the same macro logic between lib and src, and to move
it to the curlx namespace, to match `curlx_free()` that it's calling.

Closes #21151
This commit is contained in:
Viktor Szakats 2026-03-30 01:54:10 +02:00
parent 2b3dfb4ad4
commit 0df6c01db3
No known key found for this signature in database
72 changed files with 494 additions and 500 deletions

View file

@ -1322,14 +1322,14 @@ extern curl_strdup_callback Curl_cstrdup;
extern curl_calloc_callback Curl_ccalloc;
/*
* Curl_safefree defined as a macro to allow MemoryTracking feature
* to log free() calls at same location where Curl_safefree is used.
* curlx_safefree() defined as a macro to allow MemoryTracking feature
* to log free() calls at same location where curlx_safefree() is used.
* This macro also assigns NULL to given pointer when free'd.
*/
#define Curl_safefree(ptr) \
do { \
curlx_free(ptr); \
(ptr) = NULL; \
#define curlx_safefree(ptr) \
do { \
curlx_free(ptr); \
(ptr) = NULL; \
} while(0)
#include <curl/curl.h> /* for CURL_EXTERN, curl_socket_t, mprintf.h */