Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4163 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7474 invoked by uid 1010); 25 Aug 2003 07:10:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 6993 invoked from network); 25 Aug 2003 07:10:06 -0000 Received: from unknown (HELO bgbest.net) (212.91.188.18) by pb1.pair.com with SMTP; 25 Aug 2003 07:10:06 -0000 Received: (qmail 31922 invoked from network); 25 Aug 2003 07:10:01 -0000 Received: from unknown (HELO damagegqsaogpp) (212.91.188.170) by dns.bgbest.net with SMTP; 25 Aug 2003 07:10:01 -0000 To: "PHP-DEV" Date: Mon, 25 Aug 2003 10:10:09 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Subject: [PATCH] Memory leak reported by ccmalloc From: vma1@abv.bg ("Vesselin Atanasov") Hello. I compiled PHP with ccmalloc (a memory leak detector) and it reported two memory leaks. Here is a patch that meakes the leak reports go away. Actually only the first two allocations (GLOBAL_FUNCTION_TABLE and GLOBAL_CLASS_TABLE) are reported by ccmalloc, but I think that GLOBAL_CONSTANTS_TABLE is missing too. vesselin diff -ruN php5-200308250130.orig/Zend/zend.c php5-200308250130/Zend/zend.c --- php5-200308250130.orig/Zend/zend.c 2003-08-24 14:07:14.000000000 +0000 +++ php5-200308250130/Zend/zend.c 2003-08-25 08:13:52.000000000 +0000 @@ -685,7 +685,9 @@ zend_destroy_rsrc_list_dtors(); zend_hash_destroy(GLOBAL_FUNCTION_TABLE); + free(GLOBAL_FUNCTION_TABLE); zend_hash_destroy(GLOBAL_CLASS_TABLE); + free(GLOBAL_CLASS_TABLE); zend_hash_destroy(GLOBAL_AUTO_GLOBALS_TABLE); free(GLOBAL_AUTO_GLOBALS_TABLE); @@ -695,6 +697,7 @@ zend_shutdown_constants(TSRMLS_C); #ifdef ZTS zend_hash_destroy(GLOBAL_CONSTANTS_TABLE); + free(GLOBAL_CONSTANTS_TABLE); unregister_standard_class(); #endif }