php.net |  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: felipe@php.net 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] felipe@php.net
Description:
------------
See below. It is just like the #52041, but on method calls.

Test script:
---------------
<?php

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 ===


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-15 19:13 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: dmitry
 [2010-08-25 11:14 UTC] dmitry@php.net
Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=302764
Log: Fixed bug #52614 (Memory leak when writing on uninitialized variable returned from method call)
 [2010-08-25 11:15 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 [2010-08-25 11:15 UTC] dmitry@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC