Log memory allocated by libidn when --log-malloc active.

This commit is contained in:
Simon Kelley committed 2026-02-13 13:15:07 +00:00
1 parent e4d0bb4579
commit 3f2bfca3df
2 files changed
+12

No files matched your search

+10
View File
@@ -266,6 +266,10 @@ char *canonicalise(char *in, int *nomem)
return NULL;
}
/* IDN library doesnt call our malloc wrapper, so log this by steam */
if (ret)
malloc_log(ret, strlen(ret)+1);
return ret;
}
@@ -993,6 +997,12 @@ int expand_workspace_real(const char *func, unsigned int line, unsigned char ***
return 1;
}
void malloc_log_real(const char *func, unsigned int line, void *mem, size_t size)
{
if (mem && daemon->log_malloc)
my_syslog(LOG_INFO, _("malloc: %s:%u %zu bytes at %x"), func, line, size, hash_ptr(mem));
}
#undef free
void free_real(const char *func, unsigned int line, void *ptr)
{