php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31177 Memory leak
Submitted: 2004-12-18 10:41 UTC Modified: 2005-10-20 10:17 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: guth at fiifo dot u-psud dot fr Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2005-06-23 OS: *
Private report: No CVE-ID: None
 [2004-12-18 10:41 UTC] guth at fiifo dot u-psud dot fr
Description:
------------
The following code produces a memory leak :

/usr/src/php-5.0.3RC1/Zend/zend_execute.c(3255) :  Freeing 0x0816FB6C (16 bytes), script=/www/test3.php
=== Total 1 memory leaks detected ===

Reproduce code:
---------------
<?php

class DbGow {

	public function query() {
		throw new Exception;
	}
	
	public function select() {
		return new DbGowRecordSet($this->query());
	}

}

class DbGowRecordSet {

	public function __construct($resource) {

	}

}


$db = new DbGow;

try {
	$rs = $db->select();
}
catch(Exception $e) {
}
	
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-07 18:56 UTC] sniper@php.net
/usr/src/web/php/php5/Zend/zend_vm_execute.h(350) :  Freeing 0x0880A664 (16 bytes)

 [2005-03-29 00:49 UTC] sniper@php.net
/usr/src/php/php5/Zend/zend_vm_execute.h(370) :  Freeing 0x08FBAECC (16 bytes), script=t.php
=== Total 1 memory leaks detected ===

 [2005-10-20 10:17 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_1.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC