From fd7aa3f557b7a17cda20fd63e2c1445b15104d83 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Fri, 27 Jan 2017 07:46:25 -0500 Subject: [PATCH] lib: assert on duplicate free (count) Signed-off-by: Lou Berger --- lib/memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/memory.c b/lib/memory.c index f17915486c..b1dc01ed97 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -40,6 +40,7 @@ mt_count_alloc (struct memtype *mt, size_t size) static inline void mt_count_free (struct memtype *mt) { + assert(mt->n_alloc); mt->n_alloc--; } -- 2.39.5