php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19342 Memory Leak Setting Property Value
Submitted: 2002-09-10 13:35 UTC Modified: 2003-02-25 01:57 UTC
From: msisolak at yahoo dot com Assigned:
Status: Closed Package: COM related
PHP Version: 4.2.3 OS: Windows 2000
Private report: No CVE-ID: None
 [2002-09-10 13:35 UTC] msisolak at yahoo dot com
There appears to be a memory leak when setting a property value of a COM object in 4.2.3.  Running under ISAPI if this script is repeated memory usage continues to grow:

$adodb = new COM("ADODB.Connection");
$adodb->ConnectionString = str_repeat("this is a text string!", 1000);

Looking through the patches that have been applied, I believe that this is caused when COM.c went from 1.78 to 1.79 (which was then back-ported to 4.2.3).  In this patch at the end of do_COM_propput(), this:

FREE_VARIANT(new_value);

became this:

efree(new_value); // FREE_VARIANT does a VariantClear() which is not desired here !

If I reverse this patch I no longer see the leak and the code still appears to be working correctly.  What was the purpose of this change?  Does doing the FREE_VARIANT version cause some other issue?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-02 07:19 UTC] phanto@php.net
see 19150
 [2003-02-25 01:57 UTC] sniper@php.net
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 http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

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


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 12:01:30 2024 UTC