From 0f1365093f448e9503b618a5097eb8d6433e7710 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 22 Jul 2010 00:55:23 +0100 Subject: Trap SIGABRT so that get backtrace in the log. Improve handling of notification objects, and the printing of same to the logs. --- lib/memory.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/memory.c') diff --git a/lib/memory.c b/lib/memory.c index 5ee33aa8..2e295566 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -107,7 +107,7 @@ zerror (const char *fname, int type, size_t size) unfortunately zlog_backtrace_sigsafe does not support syslog logging at this time... */ zlog_backtrace(LOG_WARNING); - abort(); + zabort_abort(); } /*------------------------------------------------------------------------------ @@ -205,13 +205,15 @@ zfree (enum MTYPE mtype, void *ptr) { LOCK ; - free (ptr); + assert(mstat.mt[mtype].alloc > 0) ; mstat.mt[mtype].alloc--; #ifdef MEMORY_TRACKER mem_md_free(mtype, ptr) ; #endif + free (ptr); + UNLOCK ; } ; -- cgit v1.2.3