From: Lou Berger Date: Fri, 27 Jan 2017 12:46:25 +0000 (-0500) Subject: lib: assert on duplicate free (count) X-Git-Tag: frr-3.0-branchpoint~64^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=fd7aa3f557b7a17cda20fd63e2c1445b15104d83;p=matthieu%2Ffrr.git lib: assert on duplicate free (count) Signed-off-by: Lou Berger --- 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--; }