Skip to content

Commit

Permalink
fix(memory): Ensure RelaxNG parsing does not leak the parser context
Browse files Browse the repository at this point in the history
Fixes #2114
  • Loading branch information
flavorjones committed Nov 27, 2020
1 parent 6d3998b commit d170010
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ This release ends support for:
* The switch to turn off the CSS-to-XPath cache is now thread-local, rather than being shared mutable state. [[#1935](https://github.com/sparklemotion/nokogiri/issues/1935)]
* [CRuby] Fixed installation on AIX with respect to `vasprintf`. [[#1908](https://github.com/sparklemotion/nokogiri/issues/1908)]
* [CRuby] On some platforms, avoid symbol name collision with glibc's `canonicalize`. [[#2105](https://github.com/sparklemotion/nokogiri/issues/2105)]
* [JRuby] Standardize reading from IO like objects, including StringIO. [[#1888](https://github.com/sparklemotion/nokogiri/issues/1888), [#1897](https://github.com/sparklemotion/nokogiri/issues/1897)]
* [CRuby] `RelaxNG.from_document` no longer leaks memory. [[#2114](https://github.com/sparklemotion/nokogiri/issues/2114)]
* [Windows Visual C++] Fixed compiler warnings and errors. [[#2061](https://github.com/sparklemotion/nokogiri/issues/2061), [#2068](https://github.com/sparklemotion/nokogiri/issues/2068)]
* [JRuby] Standardize reading from IO like objects, including StringIO. [[#1888](https://github.com/sparklemotion/nokogiri/issues/1888), [#1897](https://github.com/sparklemotion/nokogiri/issues/1897)]
* [JRuby] Fixed document encoding regression in v1.11.0 release candidates. [[#2080](https://github.com/sparklemotion/nokogiri/issues/2080), [#2083](https://github.com/sparklemotion/nokogiri/issues/2083)] (Thanks, [@thbar](https://github.com/thbar)!)
Expand Down
2 changes: 1 addition & 1 deletion ext/nokogiri/xml_relax_ng.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static VALUE from_document(int argc, VALUE *argv, VALUE klass)
schema = xmlRelaxNGParse(ctx);

xmlSetStructuredErrorFunc(NULL, NULL);
// TODO: I've created https://github.com/sparklemotion/nokogiri/issues/2114 to clean up memory
xmlRelaxNGFreeParserCtxt(ctx);

if(NULL == schema) {
xmlErrorPtr error = xmlGetLastError();
Expand Down

0 comments on commit d170010

Please sign in to comment.