From: Arran Cudbard-Bell Date: Thu, 19 Aug 2021 01:13:47 +0000 (-0500) Subject: Free the heap X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e0f76cc431db0d7a8b1f140ed02138980837fad;p=thirdparty%2Ffreeradius-server.git Free the heap --- diff --git a/src/lib/util/heap.h b/src/lib/util/heap.h index f267972c6cb..7d36113f704 100644 --- a/src/lib/util/heap.h +++ b/src/lib/util/heap.h @@ -37,6 +37,10 @@ extern "C" { typedef unsigned int fr_heap_index_t; typedef unsigned int fr_heap_iter_t; +/** How many talloc headers need to be pre-allocated for a heap + */ +#define FR_HEAP_TALLOC_HEADERS 2 + /** Comparator to order heap elements * * Return negative numbers to put 'a' at the top of the heap. diff --git a/src/lib/util/lst_tests.c b/src/lib/util/lst_tests.c index 8dd22d1763c..4b660c32b47 100644 --- a/src/lib/util/lst_tests.c +++ b/src/lib/util/lst_tests.c @@ -508,6 +508,8 @@ static void queue_cmp(unsigned int count) TEST_MSG_ALWAYS("insert: %"PRIu64" μs\n", (end_insert - start_insert) / 1000); TEST_MSG_ALWAYS("pop-first: %"PRIu64" μs\n", (end_pop_first - start_pop) / 1000); TEST_MSG_ALWAYS("pop: %"PRIu64" μs\n", (end_pop - start_pop) / 1000); + + talloc_free(heap); } /*