Skip to content

Commit

Permalink
fix leak of libxml2 internal xmlSAXHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-riccardi committed Jul 18, 2012
1 parent 7675080 commit de3c328
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/xml_sax_parser.cc
Expand Up @@ -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();
}

Expand Down

0 comments on commit de3c328

Please sign in to comment.