Skip to content

Commit de7a212

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: ext/soap/php_http.c: Fix memory leak of header value
2 parents 5a45d71 + 85a49d4 commit de7a212

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ PHP NEWS
5252
- SOAP:
5353
. Fixed bug GH-18990, bug #81029, bug #47314 (SOAP HTTP socket not closing
5454
on object destruction). (nielsdos)
55+
. Fix memory leak when URL parsing fails in redirect. (Girgias)
5556

5657
- Standard:
5758
. Fix misleading errors in printf(). (nielsdos)

ext/soap/php_http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,11 +1144,11 @@ int make_http_soap_request(zval *this_ptr,
11441144

11451145
if ((loc = get_http_header_value(ZSTR_VAL(http_headers), "Location:")) != NULL) {
11461146
php_url *new_url = php_url_parse(loc);
1147+
efree(loc);
11471148

11481149
if (new_url != NULL) {
11491150
zend_string_release_ex(http_headers, 0);
11501151
zend_string_release_ex(http_body, 0);
1151-
efree(loc);
11521152
if (new_url->scheme == NULL && new_url->path != NULL) {
11531153
new_url->scheme = phpurl->scheme ? zend_string_copy(phpurl->scheme) : NULL;
11541154
new_url->host = phpurl->host ? zend_string_copy(phpurl->host) : NULL;

0 commit comments

Comments
 (0)