summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2009-10-11 12:53:49 +0200
committerGravatar Jonathan Beck2009-10-11 12:53:49 +0200
commit120b7348e7b9d4c92e463590de5a4de4e6bc1228 (patch)
treee65bb41ba079923233a37515c084c816e926e7b5 /src
parent5a7a91d4eb2263d2c9fd63d51bce9a4738b072d9 (diff)
downloadlibplist-120b7348e7b9d4c92e463590de5a4de4e6bc1228.tar.gz
libplist-120b7348e7b9d4c92e463590de5a4de4e6bc1228.tar.bz2
Protect plist_free against NULL nodes.
Diffstat (limited to 'src')
-rw-r--r--src/plist.c6
1 files changed, 4 insertions, 2 deletions
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)
148 148
149void plist_free(plist_t plist) 149void plist_free(plist_t plist)
150{ 150{
151 plist_free_node(plist, NULL); 151 if (plist) {
152 g_node_destroy(plist); 152 plist_free_node(plist, NULL);
153 g_node_destroy(plist);
154 }
153} 155}
154 156
155static void plist_copy_node(GNode * node, gpointer parent_node_ptr) 157static void plist_copy_node(GNode * node, gpointer parent_node_ptr)