|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56087 tidy mem leaks under some circumstances
Submitted: 2004-06-08 07:47 UTC Modified: 2004-06-08 10:49 UTC
From: Assigned: iliaa (profile)
Status: Closed Package: tidy (PECL)
PHP Version: 5CVS-2004-06-08 (dev) OS: Mac OS X 10.3
Private report: No CVE-ID: None
 [2004-06-08 07:47 UTC]
The following code reports 2 memleaks:

/opt/cvs/php5/ext/tidy/tidy.c(364) :  Freeing 0x00415C70 (16 bytes), 
/opt/cvs/php5/ext/tidy/tidy.c(357) :  Freeing 0x00415C20 (16 bytes), 
=== Total 2 memory leaks detected ===

First one for the array_merge code (if I remove the array_merge, the 
memleak disappears)

The second one for the 3rd param as an element of the 2nd param 
array. If I just add the value "utf8" there, it doesn't memleak.

Don't question the code, it's just a stripdown of a more complex one ;)

Reproduce code:
$html = "foo";
$options = array("char-encoding" => "utf8","drop-proprietary-attributes" => "yes");
$options2 = array("drop-proprietary-attributes" => "no");
$options = array_merge($options,$options2);
$tidy = new tidy();
print $tidy;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-08 10:49 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Jan 21 07:03:34 2022 UTC