From 3bf5d89efb0f8bb770963c96aec9a2eda9dd0813 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Oct 2023 13:49:20 +0100 Subject: [PATCH] Fix memory leak in error path of zend_register_list_destructors_ex --- Zend/zend_list.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Zend/zend_list.c b/Zend/zend_list.c index b3409e33ce8..369eb08d161 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -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;