summaryrefslogtreecommitdiffstats
path: root/lib/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/memory.c')
-rw-r--r--lib/memory.c6
1 files changed, 4 insertions, 2 deletions
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 ;
} ;