From 825e3da0a29d95fd8381231a4596aeaf6b8f594b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 29 Nov 2012 20:02:58 -0800 Subject: [PATCH] Fix leaky pools. --- libguac/src/pool.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libguac/src/pool.c b/libguac/src/pool.c index 153e913a..85167619 100644 --- a/libguac/src/pool.c +++ b/libguac/src/pool.c @@ -59,7 +59,20 @@ guac_pool* guac_pool_alloc(int size) { } void guac_pool_free(guac_pool* pool) { + + /* Free all ints in pool */ + guac_pool_int* current = pool->__head; + while (current != NULL) { + + guac_pool_int* old = current; + current = current->__next; + + free(old); + } + + /* Free pool */ free(pool); + } int guac_pool_next_int(guac_pool* pool) {