Permalink
Browse files

fix leak of libxml2 internal xmlSAXHandler

  • Loading branch information...
1 parent 7675080 commit de3c328c290b3100db4cf813a4a3350f5d01b1e7 @triccardi-systran triccardi-systran committed Jul 18, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/xml_sax_parser.cc
View
@@ -196,9 +196,10 @@ XmlSaxParser::parse_string(const char* str,
context_ = xmlCreateMemoryParserCtxt(str, size);
initializeContext();
context_->replaceEntities = 1;
+ xmlSAXHandler* old_sax = context_->sax;
context_->sax = &sax_handler_;
xmlParseDocument(context_);
- context_->sax = NULL;
+ context_->sax = old_sax;
releaseContext();
}

0 comments on commit de3c328

Please sign in to comment.