From c607b28b59243e0b2c1f790a42b8246527f404b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 15 Sep 2025 14:14:33 +0200 Subject: [PATCH] zend_builtin_functions: Do not allocate to store name of FLF when fetching backtrace --- Zend/zend_builtin_functions.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index b25925b89f7f9..fa2859ee4e9f1 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1991,8 +1991,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int } stack_frame = zend_new_array(8); zend_hash_real_init_mixed(stack_frame); - zend_string *name = func->common.function_name; - ZVAL_STRINGL(&tmp, ZSTR_VAL(name), ZSTR_LEN(name)); + ZVAL_STR_COPY(&tmp, func->common.function_name); _zend_hash_append_ex(stack_frame, ZSTR_KNOWN(ZEND_STR_FUNCTION), &tmp, 1); /* Steal file and line from the previous frame. */ if (call->func && ZEND_USER_CODE(call->func->common.type)) {