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

From: Date: Thu, 10 Jun 2010 17:18:07 +0000
Subject: Bug #52041 [NEW]: Memory leak when writing on uninitialized variable returned from function
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-151300@lists.php.net to get a copy of this message
From:             felipe
Operating system: Linux
PHP version:      Irrelevant
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Memory leak when writing on uninitialized variable returned from function

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 bug report at http://bugs.php.net/bug.php?id=52041&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=52041&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=52041&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=52041&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=52041&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52041&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=52041&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=52041&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=52041&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=52041&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=52041&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=52041&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=52041&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=52041&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=52041&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52041&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52041&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=52041&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=52041&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=52041&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=52041&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=52041&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#151300) next »