Skip to content

Commit

Permalink
Free DTD nodes
Browse files Browse the repository at this point in the history
DTD nodes added to a document are not freed when the document is freed.

Fixes #1784
  • Loading branch information
stevecheckoway authored and flavorjones committed Dec 1, 2018
1 parent 543968d commit 5476f20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/nokogiri/xml_document.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ static int dealloc_node_i(xmlNodePtr key, xmlNodePtr node, xmlDocPtr doc)
case XML_NAMESPACE_DECL:
xmlFreeNs((xmlNsPtr)node);
break;
case XML_DTD_NODE:
xmlFreeDtd((xmlDtdPtr)node);
break;
default:
if(node->parent == NULL) {
xmlAddChild((xmlNodePtr)doc, node);
Expand Down

0 comments on commit 5476f20

Please sign in to comment.