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

Fix memory leaks in php_http.c when call_user_function() fails

retval can be refcounted but is not destroyed.

Closes GH-18638.
This commit is contained in:
Niels Dossche
2025-05-24 16:19:53 +02:00
parent c9781111e1
commit a44e3f442f
2 changed files with 5 additions and 0 deletions

3
NEWS
View File

@@ -12,6 +12,9 @@ PHP NEWS
. Fix memory leak when calloc() fails in php_readline_completion_cb().
(nielsdos)
- Soap:
. Fix memory leaks in php_http.c when call_user_function() fails. (nielsdos)
05 Jun 2025, PHP 8.3.22
- Core:

View File

@@ -416,6 +416,7 @@ int make_http_soap_request(zval *this_ptr,
} else {
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&func);
zval_ptr_dtor(&retval);
if (request != buf) {
zend_string_release_ex(request, 0);
}
@@ -1314,6 +1315,7 @@ try_again:
} else {
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&func);
zval_ptr_dtor(&retval);
efree(content_encoding);
zend_string_release_ex(http_headers, 0);
zend_string_release_ex(http_body, 0);