php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46042 Mem. leaks when calling mb_convert_encoding using Reflection
Submitted: 2008-09-10 12:14 UTC Modified: 2008-09-10 23:19 UTC
From: felipe@php.net Assigned:
Status: Closed Package: mbstring related
PHP Version: 5.3CVS-2008-09-10 (CVS) OS: *
Private report: No CVE-ID:
 [2008-09-10 12:14 UTC] felipe@php.net
Description:
------------
See below.

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

$x = new reflectionfunction('mb_convert_encoding');
$x->invokeArgs(array(1, 2, 3));

Expected result:
----------------
Warning: mb_convert_encoding(): Unknown encoding "2" in %s on line %d
[Wed Sep 10 09:11:05 2008]  Script:  '%s'
/home/felipe/dev/php5/ext/mbstring/mbstring.c(3120) :  Freeing 0x08BC5F94 (20 bytes), script=%s
[Wed Sep 10 09:11:05 2008]  Script:  '%s'
/home/felipe/dev/php5/main/spprintf.c(764) :  Freeing 0x08BC5FD8 (79 bytes), script=%s
=== Total 2 memory leaks detected ===



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-10 12:34 UTC] felipe@php.net
See also:

$x = new reflectionfunction('mb_detect_encoding');
$x->invokeArgs(array(1,2,3));
Warning: mb_detect_encoding(): Illegal argument in %s on line 4
[Wed Sep 10 09:33:38 2008]  Script:  '%s'
/home/felipe/dev/php5/ext/mbstring/mbstring.c(3241) :  Freeing 0x08BC5F14 (20 bytes), script=%s
[Wed Sep 10 09:33:38 2008]  Script:  '%s'
/home/felipe/dev/php5/main/spprintf.c(764) :  Freeing 0x08BC5F58 (79 bytes), script=%s

-------

$x = new reflectionfunction('mb_substitute_character');
$x->invoke(array());
Warning: mb_substitute_character(): Unknown character. in %s on line 8
[Wed Sep 10 09:32:46 2008]  Script:  '%s'
/home/felipe/dev/php5/ext/mbstring/mbstring.c(2035) :  Freeing 0x08BC5BCC (20 bytes), script=%s
=== Total 1 memory leaks detected ===

 [2008-09-10 23:19 UTC] iliaa@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 15:02:26 2014 UTC