mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:11:45 +03:00
memdebug: log before free
add the debug log before freeing the memory, otherwise another thread
might allocate and log it before the free is logged.
Follow-up to a7bebd8502
Closes #19787
This commit is contained in:
parent
a7bebd8502
commit
d1b85bc49c
1 changed files with 3 additions and 3 deletions
|
|
@ -337,6 +337,9 @@ void curl_dbg_free(void *ptr, int line, const char *source)
|
|||
if(ptr) {
|
||||
struct memdebug *mem;
|
||||
|
||||
if(source)
|
||||
curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr);
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:1684)
|
||||
|
|
@ -352,9 +355,6 @@ void curl_dbg_free(void *ptr, int line, const char *source)
|
|||
/* free for real */
|
||||
(Curl_cfree)(mem);
|
||||
}
|
||||
|
||||
if(source && ptr)
|
||||
curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr);
|
||||
}
|
||||
|
||||
curl_socket_t curl_dbg_socket(int domain, int type, int protocol,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue