diff options
author | root <root@hestia.halldom.com> | 2010-07-22 00:55:23 +0100 |
---|---|---|
committer | root <root@hestia.halldom.com> | 2010-07-22 00:55:23 +0100 |
commit | 0f1365093f448e9503b618a5097eb8d6433e7710 (patch) | |
tree | 5db698d8d51a441aacd0f5d8ed6e83458bee294c /lib/memory.c | |
parent | 378deb2ebf5b34c053f212e14aa0c9d62c4bc85d (diff) | |
download | quagga-0f1365093f448e9503b618a5097eb8d6433e7710.tar.bz2 quagga-0f1365093f448e9503b618a5097eb8d6433e7710.tar.xz |
Trap SIGABRT so that get backtrace in the log.
Improve handling of notification objects, and the printing of same
to the logs.
Diffstat (limited to 'lib/memory.c')
-rw-r--r-- | lib/memory.c | 6 |
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 ; } ; |