From e6639e035eb368dd6449166fddafe4ffa3522fc4 Mon Sep 17 00:00:00 2001 From: Evan Huus Date: Wed, 24 Oct 2012 22:14:32 +0000 Subject: [PATCH] Don't use g_slist_free_full() it needs a more recent GLIB than we officially require. svn path=/trunk/; revision=45781 --- epan/wmem/wmem_allocator_glib.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/epan/wmem/wmem_allocator_glib.c b/epan/wmem/wmem_allocator_glib.c index e7481102d0..13ae1e6f5b 100644 --- a/epan/wmem/wmem_allocator_glib.c +++ b/epan/wmem/wmem_allocator_glib.c @@ -53,8 +53,17 @@ static void wmem_glib_free_all(void *private_data) { wmem_glib_allocator_t *allocator = (wmem_glib_allocator_t*) private_data; + GSList *tmp; - g_slist_free_full(allocator->block_list, &g_free); + /* We can't use g_slist_free_full() as it was only introduced in GLIB 2.28 + * while we support way back to 2.14. So loop through and manually free + * each block, then call g_slist_free(). */ + tmp = allocator->block_list; + while (tmp) { + g_free(tmp->data); + tmp = tmp->next; + } + g_slist_free(allocator->block_list); allocator->block_list = NULL; }