]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Free the heap
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 19 Aug 2021 01:13:47 +0000 (20:13 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 19 Aug 2021 01:13:47 +0000 (20:13 -0500)
src/lib/util/heap.h
src/lib/util/lst_tests.c

index f267972c6cbdc43e21efbdf4c28ec85c1d0b9c17..7d36113f70422ad847fe281ccaa138e423c32a7f 100644 (file)
@@ -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.
index 8dd22d1763cff2a6a8387df4e329ee06181bce90..4b660c32b471207e50a984deeb465500162cf8c8 100644 (file)
@@ -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);
        }
 
        /*