mirror of
https://github.com/curl/curl.git
synced 2026-08-01 07:38:02 +03:00
move Curl_safefree() definition to curl_setup.h
This commit is contained in:
parent
1c55ac1c17
commit
71164747ce
2 changed files with 8 additions and 14 deletions
|
|
@ -981,6 +981,14 @@ extern curl_realloc_callback Curl_crealloc;
|
|||
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.
|
||||
* This macro also assigns NULL to given pointer when free'd.
|
||||
*/
|
||||
#define Curl_safefree(ptr) \
|
||||
do { free((ptr)); (ptr) = NULL;} while(0)
|
||||
|
||||
#ifdef CURLDEBUG
|
||||
#define CURL_GETADDRINFO(host,serv,hint,res) \
|
||||
curl_dbg_getaddrinfo(host, serv, hint, res, __LINE__, __FILE__)
|
||||
|
|
|
|||
|
|
@ -186,18 +186,4 @@ CURL_EXTERN ALLOC_FUNC
|
|||
#define fake_sclose(x) Curl_nop_stmt
|
||||
|
||||
#endif /* CURLDEBUG */
|
||||
|
||||
/*
|
||||
** Following section applies even when CURLDEBUG is not defined.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Curl_safefree defined as a macro to allow MemoryTracking feature
|
||||
* to log free() calls at same location where Curl_safefree is used.
|
||||
* This macro also assigns NULL to given pointer when free'd.
|
||||
*/
|
||||
|
||||
#define Curl_safefree(ptr) \
|
||||
do { free((ptr)); (ptr) = NULL;} while(0)
|
||||
|
||||
#endif /* HEADER_CURL_MEMDEBUG_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue