From 8f38bf7f9e402edc14df3fe89dc0b46b1b1c3ee9 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 7 Dec 2019 00:06:05 +0100 Subject: Fix a memory leak caused by repeatedly allocating the libbacktrace state at every printed backtrace Signed-off-by: Haru --- src/common/nullpo.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/common/nullpo.h') diff --git a/src/common/nullpo.h b/src/common/nullpo.h index fc5386243..3eb002834 100644 --- a/src/common/nullpo.h +++ b/src/common/nullpo.h @@ -28,6 +28,8 @@ // if need disable asserts checks this line can be commented #define ASSERT_CHECK +struct backtrace_state; + /** Assert */ #if defined(ASSERT_CHECK) @@ -148,7 +150,12 @@ struct nullpo_interface { + void (*init) (void); + void (*final) (void); + void (*assert_report) (const char *file, int line, const char *func, const char *targetname, const char *title); + + struct backtrace_state *backtrace_state; }; #ifdef HERCULES_CORE -- cgit v1.2.3-60-g2f50