From 77be220137ba392ef7d1d94571350ccb2d8af8ae Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 17 Nov 2009 21:20:46 +0100 Subject: [PATCH 2/2] don't leak GNodes in plist_free Before recursing over its children, plist_free_node started by detaching the current GNode from its parent which means that calling g_node_destroy on the root of the tree was freeing only the top-level GNode while what was intended was to free the whole tree. Don't leak memory by not detaching children GNodes from their parents so that g_node_destroy on the toplevel GNode can clean everything. --- src/plist.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/plist.c b/src/plist.c index ed83e3c..9a73d4f 100644 --- a/src/plist.c +++ b/src/plist.c @@ -67,7 +67,6 @@ static void plist_free_data(plist_data_t data) static void plist_free_node(GNode * node, gpointer none) { plist_data_t data = NULL; - g_node_unlink(node); data = plist_get_data(node); plist_free_data(data); node->data = NULL; -- 1.6.5.2