|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52614 Memory leak when writing on uninitialized variable returned from method call
Submitted: 2010-08-15 19:12 UTC Modified: 2010-08-25 11:15 UTC
From: Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2010-08-15 19:12 UTC]
See below. It is just like the #52041, but on method calls.

Test script:

class foo {
	public $x;
	public function test() {
		return $this->x;

$foo = new foo;
$foo->test()->a = 1;

Expected result:
No memory leak

Actual result:
[Sun Aug 15 14:09:42 2010]  Script:  '../bug.php'
/home/felipe/dev/phptrunk/Zend/zend_execute.c(693) :  Freeing 0xB7C09524 (20 bytes), script=../bug.php
=== Total 1 memory leaks detected ===


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-15 19:13 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: dmitry
 [2010-08-25 11:14 UTC]
Automatic comment from SVN on behalf of dmitry
Log: Fixed bug #52614 (Memory leak when writing on uninitialized variable returned from method call)
 [2010-08-25 11:15 UTC]
-Status: Assigned +Status: Closed
 [2010-08-25 11:15 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jan 23 11:01:26 2021 UTC