Bug #72213 [Opn->Csd]: Finally leaks on nested exceptions

From: Date: Tue, 17 May 2016 07:33:13 +0000
Subject: Bug #72213 [Opn->Csd]: Finally leaks on nested exceptions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201145@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72213&edit=1

 ID:                 72213
 Updated by:         laruence@php.net
 Reported by:        nikic@php.net
 Summary:            Finally leaks on nested exceptions
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Scripting Engine problem
 PHP Version:        master-Git-2016-05-13 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5037ebf058bdc94e4426240a6d35fcf427d2eee2
Log: Fixed Bug #72213 (Finally leaks on nested exceptions)


Previous Comments:
------------------------------------------------------------------------
[2016-05-16 15:37:40] laruence@php.net

The following patch has been added/updated:

Patch Name: bug72213.diff
Revision:   1463413056
URL:        https://bugs.php.net/patch-display.php?bug=72213&patch=bug72213.diff&revision=1463413056

------------------------------------------------------------------------
[2016-05-13 14:55:30] nikic@php.net

Description:
------------
Attached script causes a leak:

caught b
[Fri May 13 16:51:34 2016]  Script:  '/home/nikic/php-src/t275.php'
/home/nikic/php-src/Zend/zend_objects.c(174) :  Freeing 0x7F6FB46740C0 (152 bytes),
script=/home/nikic/php-src/t275.php
=== Total 1 memory leaks detected ===

The leak is the exception backed up in the outer fast_call, which needs to be discarded.

Test script:
---------------
<?php
function test() {
    try {
        throw new Exception('a');
    } finally {
        try {
            throw new Exception('b');
        } finally {
        }
    }
}

try {
    test();
} catch (Exception $e) {
    echo "caught {$e->getMessage()}\n";
}




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



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


Thread (8 messages)

« previous php.bugs (#201145) next »