From 120b7348e7b9d4c92e463590de5a4de4e6bc1228 Mon Sep 17 00:00:00 2001 From: Jonathan Beck Date: Sun, 11 Oct 2009 12:53:49 +0200 Subject: Protect plist_free against NULL nodes. --- src/plist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plist.c') diff --git a/src/plist.c b/src/plist.c index 5ef3144..3b0387e 100644 --- a/src/plist.c +++ b/src/plist.c @@ -148,8 +148,10 @@ plist_t plist_new_date(int32_t sec, int32_t usec) void plist_free(plist_t plist) { - plist_free_node(plist, NULL); - g_node_destroy(plist); + if (plist) { + plist_free_node(plist, NULL); + g_node_destroy(plist); + } } static void plist_copy_node(GNode * node, gpointer parent_node_ptr) -- cgit v1.1-32-gdbae