summaryrefslogtreecommitdiff
path: root/lib/memory.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-01-30 13:07:44 -0500
committerGitHub <noreply@github.com>2017-01-30 13:07:44 -0500
commitbf21dc0a41b5d3480a21ab44ee2b8a4c066ab193 (patch)
treea34d7a0fd5432b8de118c55691691feec9a17e65 /lib/memory.c
parentba287c33cd783d365768b5e0c3261246e335a01b (diff)
parent56c8423f58945e0c6b5d3fd71a07fd7ae40d4a3f (diff)
Merge pull request #127 from LabNConsulting/working/master/patch/assert-dup-free
lib: assert on duplicate free (count)
Diffstat (limited to 'lib/memory.c')
-rw-r--r--lib/memory.c1
1 files changed, 1 insertions, 0 deletions
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--;
}