From 3f0154e42ccd2fa81bec7e8b5449519a23eee2b4 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Wed, 16 Jul 2014 18:10:33 +0000 Subject: Call free() on the skiplist structure in apr_skiplist_destroy() if it was apr_skiplist_init()ialized without a pool (ie. malloc()ed). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1611120 13f79535-47bb-0310-9956-ffa450edef68 --- tables/apr_skiplist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tables') diff --git a/tables/apr_skiplist.c b/tables/apr_skiplist.c index 3cd05e4cd..25d20e309 100644 --- a/tables/apr_skiplist.c +++ b/tables/apr_skiplist.c @@ -629,6 +629,9 @@ APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc m while (apr_skiplist_pop(sl->index, skiplisti_destroy) != NULL) ; apr_skiplist_remove_all(sl, myfree); + if (!sl->pool) { + free(sl); + } } APR_DECLARE(apr_skiplist *) apr_skiplist_merge(apr_skiplist *sl1, apr_skiplist *sl2) -- cgit v1.2.1