PHP :: Bug #76213 :: Yaf_Dispatcher memory leak
php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76213 Yaf_Dispatcher memory leak
Submitted: 2018-04-12 09:44 UTC Modified: -
From: fanjiapeng at 126 dot com Assigned:
Status: Open Package: yaf (PECL)
PHP Version: 7.2.4 OS: CentOS release 6.2 (Final)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-04-12 09:44 UTC] fanjiapeng at 126 dot com
Description:
------------
PHP environment variable USE_ZEND_ALLOC = 1 (default).
When the parameter value of the Yaf_Request_Http class is wrong, Memory leak is happened.

Test script:
---------------
<?php
$config = array(
    "application" => array(
        "directory" => realpath(dirname(__FILE__)) . "/application",
        "dispatcher" => array(
            "catchException" => 1,
        ),
    ),
);

$app = new Yaf_Application($config);

try {
    $request = new Yaf_Request_Http("/index/admin/login1");
    $app->getDispatcher()->dispatch($request);
} catch(Yaf_Exception $e) {
    var_dump($e->getMessage());
}


Expected result:
----------------
string(98) "Failed opening controller script /www/application/controllers/Error.php: No such file or directory"

Actual result:
--------------
string(98) "Failed opening controller script /www/application/controllers/Error.php: No such file or directory"
[Thu Apr 12 17:05:25 2018]  Script:  '/www/task.php'
Zend/zend_string.h(134) :  Freeing 0x00000001024029c0 (32 bytes), script=/www/task.php
[Thu Apr 12 17:05:25 2018]  Script:  '/www/task.php'
/usr/local/php/php-7.2.4/Zend/zend_objects.c(161) :  Freeing 0x000000010247e0c0 (152 bytes), script=/www/task.php
=== Total 2 memory leaks detected ===

Patches

yaf_dispatcher.patch (last revision 2018-04-12 09:45 UTC) by fanjiapeng at 126 dot com)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Aug 20 22:01:26 2018 UTC