diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-04-22 08:38:52 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-04-22 08:38:52 -0700 |
commit | 3643b505a6f95e65037c5d906e7fb81ac16698cf (patch) | |
tree | 54ea489fc1426fb326870a429f7a525e53369d28 /src | |
parent | 4223b4a3f0d2058fcfac551055550384b650f70a (diff) |
Fix node_pi memory leak
Diffstat (limited to 'src')
-rw-r--r-- | src/pugixml.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 80d9d9f..c5e77e8 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -1163,6 +1163,14 @@ PUGI__NS_BEGIN if (n->header & impl::xml_memory_page_contents_allocated_mask) alloc.deallocate_string(n->contents); + if (PUGI__NODETYPE(n) == node_pi) + { + xml_node_pi_struct* pn = static_cast<xml_node_pi_struct*>(n); + + if (pn->pi_header & impl::xml_memory_page_contents_allocated_mask) + alloc.deallocate_string(pn->pi_value); + } + for (xml_attribute_struct* attr = n->first_attribute; attr; ) { xml_attribute_struct* next = attr->next_attribute; |