|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [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 28 20:03:33 2022 UTC