add the debug log before freeing the memory, otherwise another thread
might allocate and log it before the free is logged.
Follow-up to
a7bebd8502914f1652f423
Closes #19787
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)
/* 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,