Skip Menu |

This queue is for tickets about the XML-Parser CPAN distribution.

Report information
The Basics
Id: 7630
Status: resolved
Priority: 0/
Queue: XML-Parser

People
Owner: Nobody in particular
Requestors: jc [...] directinfos.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.34
Fixed in: (no value)



Subject: Memory leak in XML::Parser::Expat (with patch)
There is a memory leak in XML::Parser::Expat in sub parse: it attempts to use the argument as a IO::Handle, and while doing this auto-instantiates a variable named after it. It gets even worse if the variable contains quotes which are interpreted as package name separators. There was an earlier attempt to fix it by adding a if (defined *{$arg}) but this apparently does not work in all versions of perl, since the problem still appears both in 5.005_03 and in 5.6.1. The following patch fixes the issue in the above versions: --- XML-Parser-2.34/Expat/Expat.pm.orig Mon Sep 13 18:06:34 2004 +++ XML-Parser-2.34/Expat/Expat.pm Mon Sep 13 18:06:47 2004 @@ -453,7 +453,7 @@ require IO::Handle; eval { no strict 'refs'; - $ioref = *{$arg}{IO} if defined *{$arg}; + $ioref = *{$arg}{IO} if (ref $args && defined *{$arg}); }; undef $@; } Let me know if you need any further information. Thanks, Jacques.
Ticket migrated to github as https://github.com/toddr/XML-Parser/issues/27