Skip to content

Commit 6dd2eaf

Browse files
committed
Remove unnecessary string copy
1 parent c136afa commit 6dd2eaf

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Zend/zend.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,8 +1102,6 @@ ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) /* {{{ */
11021102
static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list args)
11031103
#endif
11041104
{
1105-
char *str;
1106-
int len;
11071105
#if !defined(HAVE_NORETURN) || defined(HAVE_NORETURN_ALIAS)
11081106
va_list args;
11091107
#endif
@@ -1244,9 +1242,7 @@ static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list a
12441242
# endif
12451243
#endif
12461244
va_copy(usr_copy, args);
1247-
len = (int)zend_vspprintf(&str, 0, format, usr_copy);
1248-
ZVAL_NEW_STR(&params[1], zend_string_init(str, len, 0));
1249-
efree(str);
1245+
ZVAL_STR(&params[1], zend_vstrpprintf(0, format, usr_copy));
12501246
#ifdef va_copy
12511247
va_end(usr_copy);
12521248
#endif

0 commit comments

Comments
 (0)