summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_malloc.c')
-rw-r--r--src/nxt_malloc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/nxt_malloc.c b/src/nxt_malloc.c
index fed58e96..5ea7322f 100644
--- a/src/nxt_malloc.c
+++ b/src/nxt_malloc.c
@@ -64,17 +64,24 @@ nxt_zalloc(size_t size)
void *
nxt_realloc(void *p, size_t size)
{
- void *n;
+ void *n;
+ uintptr_t ptr;
+
+ /*
+ * Workaround for a warning on GCC 12 about using "p" pointer in debug log
+ * after realloc().
+ */
+ ptr = (uintptr_t) p;
n = realloc(p, size);
if (nxt_fast_path(n != NULL)) {
- nxt_log_debug(nxt_malloc_log(), "realloc(%p, %uz): %p", p, size, n);
+ nxt_log_debug(nxt_malloc_log(), "realloc(%p, %uz): %p", ptr, size, n);
} else {
nxt_log_alert_moderate(&nxt_malloc_log_moderation, nxt_malloc_log(),
"realloc(%p, %uz) failed %E",
- p, size, nxt_errno);
+ ptr, size, nxt_errno);
}
return n;