Bug #52041 [Asn]: Memory leak when writing on uninitialized variable returned from function

From: Date: Thu, 10 Jun 2010 17:19:48 +0000
Subject: Bug #52041 [Asn]: Memory leak when writing on uninitialized variable returned from function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-151302@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52041&edit=1

 ID:               52041
 Updated by:       felipe@php.net
 Reported by:      felipe@php.net
 Summary:          Memory leak when writing on uninitialized variable
                   returned from function
 Status:           Assigned
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: Linux
 PHP Version:      5.2, 5.3, Trunk
 Assigned To:      dmitry

 New Comment:

It is also reproducible with:
foo()[] = 1;


Previous Comments:
------------------------------------------------------------------------
[2010-06-10 19:18:05] felipe@php.net

Description:
------------
See below.

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

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


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52041&edit=1


Thread (4 messages)

« previous php.bugs (#151302) next »