php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62915 Memory leak when cloning unconstructed object
Submitted: 2012-08-23 23:17 UTC Modified: 2012-08-26 21:54 UTC
From: felipe@php.net Assigned: cataphract
Status: Closed Package: I18N and L10N related
PHP Version: Irrelevant OS:
Private report: No CVE-ID:
 [2012-08-23 23:17 UTC] felipe@php.net
Description:
------------
See below.

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

class foo extends IntlTimeZone {
	public $foo = 'test';
	
	public function __construct() { }
}

$x = new foo;

try {
	$z = clone $x;
} catch (Exception $e) {
	var_dump($e->getMessage());
}


Actual result:
--------------
/home/felipe/dev/php-src/Zend/zend_API.c(1097) :  Freeing 0x7F4A715F1288 (32 bytes), script=-
[Thu Aug 23 20:13:00 2012]  Script:  '-'
/home/felipe/dev/php-src/Zend/zend_API.c(1098) :  Freeing 0x7F4A715F1DD8 (5 bytes), script=-
/home/felipe/dev/php-src/Zend/zend_variables.c(121) : Actual location (location was relayed)
=== Total 2 memory leaks detected ===]]>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-23 23:39 UTC] felipe@php.net
Same problem is reproducible with:
- NumberFormatter
- MessageFormatter
- IntlDateFormatter
 [2012-08-24 02:27 UTC] laruence@php.net
Hmm, wrong usage at first,  I think this should be marked as a low priority task. 
:)
 [2012-08-24 15:16 UTC] laruence@php.net
-Assigned To: +Assigned To: cataphract
 [2012-08-24 15:16 UTC] laruence@php.net
maybe you can also take care of this :)
 [2012-08-26 21:54 UTC] cataphract@php.net
-Status: Assigned +Status: Closed
 [2012-08-26 21:54 UTC] cataphract@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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Apr 30 22:01:36 2017 UTC