Skip to content

Commit ce3869b

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix Soap leaking http_msg on error
2 parents 0ee170b + 66cb6cd commit ce3869b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ PHP NEWS
9696

9797
- SOAP:
9898
. Fixed bug GH-16237 (Segmentation fault when cloning SoapServer). (nielsdos)
99+
. Fix Soap leaking http_msg on error. (nielsdos)
99100

100101
- Standard:
101102
. Fixed bug GH-16053 (Assertion failure in Zend/zend_hash.c). (Arnaud)

ext/soap/php_http.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ int make_http_soap_request(zval *this_ptr,
456456
}
457457
add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL);
458458
smart_str_free(&soap_headers_z);
459+
efree(http_msg);
459460
return FALSE;
460461
}
461462

@@ -469,6 +470,7 @@ int make_http_soap_request(zval *this_ptr,
469470
}
470471
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL);
471472
smart_str_free(&soap_headers_z);
473+
efree(http_msg);
472474
return FALSE;
473475
}
474476

@@ -482,6 +484,7 @@ int make_http_soap_request(zval *this_ptr,
482484
add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL);
483485
PG(allow_url_fopen) = old_allow_url_fopen;
484486
smart_str_free(&soap_headers_z);
487+
efree(http_msg);
485488
return FALSE;
486489
}
487490

@@ -536,6 +539,7 @@ int make_http_soap_request(zval *this_ptr,
536539
add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL);
537540
PG(allow_url_fopen) = old_allow_url_fopen;
538541
smart_str_free(&soap_headers_z);
542+
efree(http_msg);
539543
return FALSE;
540544
}
541545
}
@@ -687,6 +691,7 @@ int make_http_soap_request(zval *this_ptr,
687691
convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr));
688692
smart_str_free(&soap_headers_z);
689693
smart_str_free(&soap_headers);
694+
efree(http_msg);
690695
return FALSE;
691696
}
692697

@@ -904,12 +909,14 @@ int make_http_soap_request(zval *this_ptr,
904909
convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr));
905910
add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL);
906911
smart_str_free(&soap_headers_z);
912+
efree(http_msg);
907913
return FALSE;
908914
}
909915
smart_str_free(&soap_headers);
910916
} else {
911917
add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL);
912918
smart_str_free(&soap_headers_z);
919+
efree(http_msg);
913920
return FALSE;
914921
}
915922

@@ -926,6 +933,7 @@ int make_http_soap_request(zval *this_ptr,
926933
convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr));
927934
add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL);
928935
smart_str_free(&soap_headers_z);
936+
efree(http_msg);
929937
return FALSE;
930938
}
931939

@@ -1173,6 +1181,7 @@ int make_http_soap_request(zval *this_ptr,
11731181
if (--redirect_max < 1) {
11741182
add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL);
11751183
smart_str_free(&soap_headers_z);
1184+
efree(http_msg);
11761185
return FALSE;
11771186
}
11781187

0 commit comments

Comments
 (0)