php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27640 [PATCH] memory leak of registered_zend_ini_directives table
Submitted: 2004-03-18 16:42 UTC Modified: 2004-05-23 18:06 UTC
From: msisolak at yahoo dot com Assigned: andi
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0RC1 OS: Windows 2000
Private report: No CVE-ID:
 [2004-03-18 16:42 UTC] msisolak at yahoo dot com
Description:
------------
Under thread-safe builds the registered_zend_ini_directives hash table leaks (verified under Win32 with a _CrtDumpMemoryLeaks() call at the bottom of the CLI main() function).  There is a zend_ini_global_shutdown() function in zend_ini.c to free this table, but it never gets called.

A suggested patch:

--- main.c.orig	Thu Mar 18 16:34:09 2004
+++ main.c	Thu Mar 18 16:34:22 2004
@@ -1523,9 +1523,9 @@
 
 	/* close down the ini config */
 	php_shutdown_config();
+	zend_ini_global_shutdown(TSRMLS_C);
 
 #ifndef ZTS
-	zend_ini_shutdown(TSRMLS_C);
 	shutdown_memory_manager(CG(unclean_shutdown), 1 TSRMLS_CC);
 #endif
 
Since registered_zend_ini_directives is the same as EG(ini_directives) under non-thread safe builds, calling zend_ini_global_shutdown() in either case should be fine.

Reproduce code:
---------------
Just calling "php.exe -v" caused the memory leak - no script is required.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-13 13:10 UTC] sniper@php.net
Andi, please take a look.

 [2004-05-23 18:06 UTC] andi@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 05:03:21 2014 UTC