Bug #70431 [NEW]: Memory leak in php_ini.c

From: Date: Fri, 04 Sep 2015 20:59:43 +0000
Subject: Bug #70431 [NEW]: Memory leak in php_ini.c
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195771@lists.php.net to get a copy of this message
From: sixd Operating system: Linux PHP version: 7.0Git-2015-09-04 (Git) Package: Scripting Engine problem Bug Type: Bug Bug description:Memory leak in php_ini.c Description: ------------ ==12787== 51 bytes in 1 blocks are definitely lost in loss record 363 of 675 ==12787== at 0x4A069EE: malloc (vg_replace_malloc.c:270) ==12787== by 0x681D37: _estrndup (zend_alloc.c:2516) ==12787== by 0x64E44D: expand_filepath_with_mode (fopen_wrappers.c:822) ==12787== by 0x650B8E: php_init_config (php_ini.c:555) ==12787== by 0x64A5A4: php_module_startup (main.c:2147) ==12787== by 0x73B3CC: php_cli_startup (php_cli.c:423) ==12787== by 0x73CEE3: main (php_cli.c:1322) Fix (from @Senthil) is: --- php_ini.c.orig 2015-09-05 00:02:16.000000000 +1000 +++ php_ini.c 2015-09-04 23:58:13.000000000 +1000 @@ -600,6 +600,8 @@ if (opened_path) { zend_string_release(opened_path); } + efree((char*) fh.filename); + fh.filename = (char *) NULL; php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); } } -- Edit bug report at https://bugs.php.net/bug.php?id=70431&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70431&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70431&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70431&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70431&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70431&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70431&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70431&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70431&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70431&r=support Expected behavior: https://bugs.php.net/fix.php?id=70431&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70431&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70431&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70431&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70431&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70431&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70431&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70431&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70431&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70431&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70431&r=mysqlcfg

« previous php.bugs (#195771) next »