From 1f6f9c70cb4e82ca9fbbf3153173e3d73a0f9170 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 31 Aug 2020 15:10:09 +0200 Subject: Fix leak on consteval exception in ReflectionClass::__toString() --- ext/reflection/php_reflection.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index df00e5b4ba..620d95afa4 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -373,6 +373,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->constants_table, key, c) { _class_const_string(str, ZSTR_VAL(key), c, ZSTR_VAL(sub_indent)); if (UNEXPECTED(EG(exception))) { + zend_string_release(sub_indent); return; } } ZEND_HASH_FOREACH_END(); -- cgit v1.2.1