Skip to content

Commit 85a49d4

Browse files
Girgiasnielsdos
authored andcommitted
ext/soap/php_http.c: Fix memory leak of header value
1 parent 974526b commit 85a49d4

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
@@ -45,6 +45,7 @@ PHP NEWS
4545
- SOAP:
4646
. Fixed bug GH-18990, bug #81029, bug #47314 (SOAP HTTP socket not closing
4747
on object destruction). (nielsdos)
48+
. Fix memory leak when URL parsing fails in redirect. (Girgias)
4849

4950
- Standard:
5051
. 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
@@ -1128,11 +1128,11 @@ int make_http_soap_request(zval *this_ptr,
11281128

11291129
if ((loc = get_http_header_value(ZSTR_VAL(http_headers), "Location: ")) != NULL) {
11301130
php_url *new_url = php_url_parse(loc);
1131+
efree(loc);
11311132

11321133
if (new_url != NULL) {
11331134
zend_string_release_ex(http_headers, 0);
11341135
zend_string_release_ex(http_body, 0);
1135-
efree(loc);
11361136
if (new_url->scheme == NULL && new_url->path != NULL) {
11371137
new_url->scheme = phpurl->scheme ? zend_string_copy(phpurl->scheme) : NULL;
11381138
new_url->host = phpurl->host ? zend_string_copy(phpurl->host) : NULL;

0 commit comments

Comments
 (0)