Bug #10029 Updated: zend_list_do_delete() ignores HashTable* param. Potential mem leak.
| From: | zeev@php.net | Date: | Mon, 30 Apr 2001 09:15:29 +0000 |
| Subject: | Bug #10029 Updated: zend_list_do_delete() ignores HashTable* param. Potential mem leak. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-53041@lists.php.net to get a copy of this message | ||
ID: 10029
Updated by: zeev
Reported By: dan@libby.com
Old-Status: Open
Status: Closed
Bug Type: Unknown/Other Function
PHP Version: 4.0.4pl1
Assigned To:
Comments:
zend_plist_delete() was redundant and removed from the CVS a few weeks ago (it didn't make it
for 4.0.5, but will be in 4.0.6)
Previous Comments:
---------------------------------------------------------------------------
[2001-03-27 13:54:23] dan@libby.com
from Zend/zend_list.c
Note that list is passed in, but &EG(regular_list) is used wherever list should be used.
static inline int zend_list_do_delete(HashTable *list,int id)
{
zend_rsrc_list_entry *le;
ELS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("del(%d): %d->%dn", id, le->refcount, le->refcount-1); */
if (--le->refcount<=0) {
return zend_hash_index_del(&EG(regular_list), id);
} else {
return SUCCESS;
}
} else {
return FAILURE;
}
}
.
.
.
Scroll down, and we see that both zend_list_delete and zend_plist_delete are calling this with
different hashtable args. It looks as though we must be leaking memory whenever zend_plist_delete
is called.
ZEND_API int zend_list_delete(int id)
{
ELS_FETCH();
return zend_list_do_delete(&EG(regular_list), id);
}
ZEND_API int zend_plist_delete(int id)
{
ELS_FETCH();
return zend_list_do_delete(&EG(persistent_list), id);
}
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10029&edit=2