From a204cd8601d1d53a758efaa3e1b54633087bfbbf Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Wed, 2 Aug 2017 21:14:03 +0200
Subject: [PATCH] fix constant leak in sax parser

---
 alib2common/src/sax/SaxParseInterface.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/alib2common/src/sax/SaxParseInterface.cpp b/alib2common/src/sax/SaxParseInterface.cpp
index a142bddf1f..7e4cda590f 100644
--- a/alib2common/src/sax/SaxParseInterface.cpp
+++ b/alib2common/src/sax/SaxParseInterface.cpp
@@ -26,6 +26,7 @@ void SaxParseInterface::parseMemory(const std::string& xmlIn, std::deque<Token>&
 	xmlFreeTextReader(reader);
 	xmlFreeParserInputBuffer(buf);
 	xmlCleanupCharEncodingHandlers();
+	xmlCleanupParser();
 
 	if (result != 0) {
 		throw exception::CommonException("Cannot parse the XML file " + xmlIn);
@@ -38,6 +39,8 @@ void SaxParseInterface::parseFile(const std::string& filename, std::deque<Token>
 	int result = SaxParseInterface::xmlSAXUserParse(reader, out);
 
 	xmlFreeTextReader(reader);
+	xmlCleanupCharEncodingHandlers();
+	xmlCleanupParser();
 
 	if (result != 0) {
 		throw exception::CommonException("Cannot parse the XML file " + filename);
-- 
GitLab