Skip to content

Commit

Permalink
Remove unnecessary string copy
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jun 25, 2017
1 parent c136afa commit 6dd2eaf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,8 +1102,6 @@ ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) /* {{{ */
static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list args)
#endif
{
char *str;
int len;
#if !defined(HAVE_NORETURN) || defined(HAVE_NORETURN_ALIAS)
va_list args;
#endif
Expand Down Expand Up @@ -1244,9 +1242,7 @@ static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list a
# endif
#endif
va_copy(usr_copy, args);
len = (int)zend_vspprintf(&str, 0, format, usr_copy);
ZVAL_NEW_STR(&params[1], zend_string_init(str, len, 0));
efree(str);
ZVAL_STR(&params[1], zend_vstrpprintf(0, format, usr_copy));
#ifdef va_copy
va_end(usr_copy);
#endif
Expand Down

0 comments on commit 6dd2eaf

Please sign in to comment.