Skip to content
This repository
Browse code

fix leak of libxml2 internal xmlSAXHandler

  • Loading branch information...
commit de3c328c290b3100db4cf813a4a3350f5d01b1e7 1 parent 7675080
Thomas Riccardi triccardi-systran authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  src/xml_sax_parser.cc
3  src/xml_sax_parser.cc
@@ -196,9 +196,10 @@ XmlSaxParser::parse_string(const char* str,
196 196 context_ = xmlCreateMemoryParserCtxt(str, size);
197 197 initializeContext();
198 198 context_->replaceEntities = 1;
  199 + xmlSAXHandler* old_sax = context_->sax;
199 200 context_->sax = &sax_handler_;
200 201 xmlParseDocument(context_);
201   - context_->sax = NULL;
  202 + context_->sax = old_sax;
202 203 releaseContext();
203 204 }
204 205

0 comments on commit de3c328

Please sign in to comment.
Something went wrong with that request. Please try again.