mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
Fix stream leak in phar cache_list
This commit is contained in:
parent
74a7d00846
commit
c7962207d7
@ -206,7 +206,7 @@ void plist_entry_destructor(zval *zv)
|
||||
free(res);
|
||||
}
|
||||
|
||||
int zend_init_rsrc_list(void)
|
||||
ZEND_API int zend_init_rsrc_list(void)
|
||||
{
|
||||
zend_hash_init(&EG(regular_list), 8, NULL, list_entry_destructor, 0);
|
||||
return SUCCESS;
|
||||
|
@ -45,7 +45,7 @@ void list_entry_destructor(zval *ptr);
|
||||
void plist_entry_destructor(zval *ptr);
|
||||
|
||||
void zend_clean_module_rsrc_dtors(int module_number);
|
||||
int zend_init_rsrc_list(void);
|
||||
ZEND_API int zend_init_rsrc_list(void); /* Exported for phar hack */
|
||||
int zend_init_rsrc_plist(void);
|
||||
void zend_close_rsrc_list(HashTable *ht);
|
||||
void zend_destroy_rsrc_list(HashTable *ht);
|
||||
|
@ -113,7 +113,7 @@ static void phar_split_cache_list(void) /* {{{ */
|
||||
|
||||
/* fake request startup */
|
||||
PHAR_G(request_init) = 1;
|
||||
zend_hash_init(&EG(regular_list), 0, NULL, NULL, 0);
|
||||
zend_init_rsrc_list();
|
||||
EG(regular_list).nNextFreeElement=1; /* we don't want resource id 0 */
|
||||
|
||||
PHAR_G(has_bz2) = zend_hash_str_exists(&module_registry, "bz2", sizeof("bz2")-1);
|
||||
|
Loading…
Reference in New Issue
Block a user