mysql_query() is allocating memory incorrectly

Bug #40883 mysql_query() is allocating memory incorrectly
Submitted: 2007-03-21 16:13 UTC Modified: 2007-03-23 08:00 UTC
From: edwin at aucs dot org Assigned: dmitry (profile)
Status: Closed Package: MySQL related
PHP Version: 5.2.1 OS: WinXP
Private report: No CVE-ID: None

 [2007-03-21 16:13 UTC] edwin at aucs dot org

Description:
------------
Memory leak in mysql_query, memory not being able to be freed by mysql_free_result properly

Reproduce code:
---------------
Refer to Listing 4 to 7 of http://www-128.ibm.com/developerworks/opensource/library/os-php-v521/

Expected result:
----------------
No memory leakage

Actual result:
--------------
mysql_query() is allocating memory incorrectly, even with the latest CVS snap

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2007-03-23 08:00 UTC] dmitry@php.net

The problem was in Zend Memory Manager, that cached small memory blocks and didn't reuse cache on erealloc().

Fixed in CVS HEAD and PHP_5_2.