Don't log free(NULL) calls.

This commit is contained in:
Simon Kelley
2026-01-24 23:07:40 +00:00
parent b148ba4752
commit f1fa05d754

View File

@@ -959,7 +959,7 @@ void *whine_realloc_real(const char *func, unsigned int line, void *ptr, size_t
void free_real(const char *func, unsigned int line, void *ptr)
{
if (option_bool(OPT_LOG_MALLOC))
if (ptr && option_bool(OPT_LOG_MALLOC))
my_syslog(LOG_INFO, _("free: %s:%u block at %x"), func, line, hash_ptr(ptr));
#undef free