|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52041 Memory leak when writing on uninitialized variable returned from function
Submitted: 2010-06-10 19:18 UTC Modified: 2010-06-15 10:25 UTC
From: Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.2, 5.3, Trunk OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
24 - 18 = ?
Subscribe to this entry?

 [2010-06-10 19:18 UTC]
See below.

Test script:

function foo() {
	return $x;

foo()->a = 1;

Expected result:
No memory leak.

Actual result:
Zend/zend_execute.c(723) :  Freeing 0x0A395E1C (20 bytes), script=../bug.php
=== Total 1 memory leaks detected ===


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-10 19:18 UTC]
-Status: Open +Status: Assigned -PHP Version: Irrelevant +PHP Version: 5.2, 5.3, Trunk -Assigned To: +Assigned To: dmitry
 [2010-06-10 19:19 UTC]
It is also reproducible with:
foo()[] = 1;
 [2010-06-15 10:22 UTC]
Automatic comment from SVN on behalf of dmitry
Log: Fixed bug #52041 (Memory leak when writing on uninitialized variable returned from function)
 [2010-06-15 10:25 UTC]
-Status: Assigned +Status: Closed
 [2010-06-15 10:25 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-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 08:01:31 2023 UTC