php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61072 Memory leak when restoring an exception handler
Submitted: 2012-02-13 16:49 UTC Modified: 2012-03-02 02:56 UTC
From: nikic@php.net Assigned: laruence (profile)
Status: Closed Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nikic@php.net
New email:
PHP Version: OS:

 

 [2012-02-13 16:49 UTC] nikic@php.net
Description:
------------
The script:

$callback = function() { };
set_exception_handler($callback);
restore_exception_handler();

Leaks:

[Mon Feb 13 17:34:31 2012]  Script:  'workingFile18.php'
/home/nikic/dev/php-src/Zend/zend_builtin_functions.c(1610) :  Freeing 
0xB7893050 (20 bytes), script=workingFile18.php
=== Total 1 memory leaks detected ===

Fixing it is just a matter of adding:

INIT_PZVAL(EG(user_exception_handler));

After http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_builtin_functions.c#1619.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-14 05:35 UTC] laruence@php.net
Automatic comment from SVN on behalf of laruence
Revision: http://svn.php.net/viewvc/?view=revision&revision=323199
Log: Fixed bug #61072 (Memory leak when restoring an exception handler)
 [2012-02-14 05:36 UTC] laruence@php.net
Fixed in 5.3 and trunk, will close this after ci to 5.4
 [2012-02-14 05:36 UTC] laruence@php.net
-Assigned To: +Assigned To: laruence
 [2012-03-02 02:56 UTC] laruence@php.net
Automatic comment from SVN on behalf of laruence
Revision: http://svn.php.net/viewvc/?view=revision&revision=323766
Log: MFH: Fixed bug #61072 (Memory leak when restoring an exception handler).
 [2012-03-02 02:56 UTC] laruence@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.


 [2012-03-02 02:56 UTC] laruence@php.net
-Status: Assigned +Status: Closed
 [2012-04-18 09:45 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4f0bbee3ef4ccf2db27175fe6b9d4659286ed913
Log: MFH: Fixed bug #61072 (Memory leak when restoring an exception handler).
 [2012-04-18 09:46 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5d683614f9ae35dfee85d6502baa22ed3bd6581b
Log: Fixed bug #61072 (Memory leak when restoring an exception handler)
 [2012-07-24 23:37 UTC] rasmus@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4f0bbee3ef4ccf2db27175fe6b9d4659286ed913
Log: MFH: Fixed bug #61072 (Memory leak when restoring an exception handler).
 [2012-07-24 23:37 UTC] rasmus@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5d683614f9ae35dfee85d6502baa22ed3bd6581b
Log: Fixed bug #61072 (Memory leak when restoring an exception handler)
 [2013-11-17 09:33 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4f0bbee3ef4ccf2db27175fe6b9d4659286ed913
Log: MFH: Fixed bug #61072 (Memory leak when restoring an exception handler).
 [2013-11-17 09:33 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5d683614f9ae35dfee85d6502baa22ed3bd6581b
Log: Fixed bug #61072 (Memory leak when restoring an exception handler)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Apr 01 03:01:29 2025 UTC