From b05d50eac2b50a0418b60582fc0e363299ad910d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 28 May 2025 19:18:12 +0200 Subject: [PATCH] Avoid creating a zend_string twice in soap do_request --- ext/soap/soap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 4c945634009..09043886b9c 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2221,12 +2221,6 @@ static bool do_request(zval *this_ptr, xmlDoc *request, const char *location, co } zend_try { - zval *trace = Z_CLIENT_TRACE_P(this_ptr); - if (Z_TYPE_P(trace) == IS_TRUE) { - zval_ptr_dtor(Z_CLIENT_LAST_REQUEST_P(this_ptr)); - ZVAL_STRINGL(Z_CLIENT_LAST_REQUEST_P(this_ptr), buf, buf_size); - } - ZVAL_STRINGL(¶ms[0], buf, buf_size); ZVAL_STRING(¶ms[1], location); if (action == NULL) { @@ -2237,6 +2231,12 @@ static bool do_request(zval *this_ptr, xmlDoc *request, const char *location, co ZVAL_LONG(¶ms[3], version); ZVAL_BOOL(¶ms[4], one_way); + zval *trace = Z_CLIENT_TRACE_P(this_ptr); + if (Z_TYPE_P(trace) == IS_TRUE) { + zval_ptr_dtor(Z_CLIENT_LAST_REQUEST_P(this_ptr)); + ZVAL_COPY(Z_CLIENT_LAST_REQUEST_P(this_ptr), ¶ms[0]); + } + zend_function *func = zend_hash_str_find_ptr(&Z_OBJCE_P(this_ptr)->function_table, ZEND_STRL("__dorequest")); ZEND_ASSERT(func != NULL);