summaryrefslogtreecommitdiffstats
path: root/src/xplist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xplist.c')
-rw-r--r--src/xplist.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/xplist.c b/src/xplist.c
index e368b8b..1ee0138 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -556,6 +556,14 @@ PLIST_API void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length)
setlocale(LC_NUMERIC, saved_locale);
free(saved_locale);
}
+
+ /* free memory from parser initialization */
+ xmlCleanupCharEncodingHandlers();
+ xmlDictCleanup();
+ xmlResetLastError();
+ xmlCleanupGlobals();
+ xmlCleanupThreads();
+ xmlCleanupMemory();
}
static xmlParserInputPtr plist_xml_external_entity_loader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt)
@@ -576,4 +584,12 @@ PLIST_API void plist_from_xml(const char *plist_xml, uint32_t length, plist_t *
xml_to_node(root_node, plist);
xmlFreeDoc(plist_doc);
}
+
+ /* free memory from parser initialization */
+ xmlCleanupCharEncodingHandlers();
+ xmlDictCleanup();
+ xmlResetLastError();
+ xmlCleanupGlobals();
+ xmlCleanupThreads();
+ xmlCleanupMemory();
}