File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1013,7 +1013,13 @@ PHP_METHOD(SoapServer, __construct)
10131013 service -> soap_functions .ft = zend_new_array (0 );
10141014
10151015 if (wsdl ) {
1016- service -> sdl = get_sdl (ZEND_THIS , ZSTR_VAL (wsdl ), cache_wsdl );
1016+ zend_try {
1017+ service -> sdl = get_sdl (ZEND_THIS , ZSTR_VAL (wsdl ), cache_wsdl );
1018+ } zend_catch {
1019+ xmlCharEncCloseFunc (service -> encoding );
1020+ service -> encoding = NULL ;
1021+ zend_bailout ();
1022+ } zend_end_try ();
10171023 if (service -> uri == NULL ) {
10181024 if (service -> sdl -> target_ns ) {
10191025 service -> uri = estrdup (service -> sdl -> target_ns );
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-19784 (SoapServer memory leak)
3+ --EXTENSIONS--
4+ soap
5+ --FILE--
6+ <?php
7+ $ v_5256 = 'zpHOks6TzpTOlc6WzpfOmM6ZzprOm86czp3Ons6fzqDOoc6jzqTOpc6mzqfOqM6p ' ;
8+ $ v_5257 = base64_decode ($ v_5256 ,);
9+ $ v_5238 = array ('encoding ' => $ v_5257 );
10+ new SoapServer ('foobarbaz ' ,$ v_5238 ,);
11+ ?>
12+ --EXPECTF--
13+ <? xml version="1.0 " encoding="UTF -8 "?>
14+ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>%s</faultcode><faultstring>%a
You can’t perform that action at this time.
0 commit comments