1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Avoid creating a zend_string twice in soap do_request

This commit is contained in:
Niels Dossche
2025-05-28 19:18:12 +02:00
parent 99bc0a56a6
commit b05d50eac2

View File

@@ -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(&params[0], buf, buf_size);
ZVAL_STRING(&params[1], location);
if (action == NULL) {
@@ -2237,6 +2231,12 @@ static bool do_request(zval *this_ptr, xmlDoc *request, const char *location, co
ZVAL_LONG(&params[3], version);
ZVAL_BOOL(&params[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), &params[0]);
}
zend_function *func = zend_hash_str_find_ptr(&Z_OBJCE_P(this_ptr)->function_table, ZEND_STRL("__dorequest"));
ZEND_ASSERT(func != NULL);