1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix memory leak in error path of zend_register_list_destructors_ex

This commit is contained in:
Niels Dossche
2023-10-29 13:49:20 +01:00
parent 29dbc4ae83
commit 3bf5d89efb

View File

@@ -275,6 +275,7 @@ ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_fu
ZVAL_PTR(&zv, lde);
if (zend_hash_next_index_insert(&list_destructors, &zv) == NULL) {
free(lde);
return FAILURE;
}
return list_destructors.nNextFreeElement-1;