Subject: | getChildrenByTagNameNS cause memory leaks |
getChildrenByTagNameNS cause memory leaks.
my libxml version is 2.6.27.
leak code is here:
use strict;
use warnings;
use XML::LibXML;
my $doc = XML::LibXML::Document->new('1.0', 'utf8');
while(1) {
my $title = $doc->createElement('title');
$title->getChildrenByTagNameNS('http://purl.org/atom/ns#', 'title');
}
patch is here:
--- LibXML.xs.orig 2008-07-30 08:49:37.000000000 +0900
+++ LibXML.xs 2008-07-30 08:53:12.000000000 +0900
@@ -4205,6 +4205,8 @@
if ( wantarray == G_SCALAR ) {
XPUSHs(sv_2mortal(newSViv(len)) );
}
+ xmlFree(name);
+ xmlFree(nsURI);
SV*
firstChild( self )
regards.