@@ -1485,7 +1485,7 @@ PHP_METHOD(SoapServer, handle)
1485
1485
int soap_version , old_soap_version ;
1486
1486
sdlPtr old_sdl = NULL ;
1487
1487
soapServicePtr service ;
1488
- xmlDocPtr doc_request = NULL , doc_return ;
1488
+ xmlDocPtr doc_request = NULL , doc_return = NULL ;
1489
1489
zval function_name , * params , * soap_obj , retval ;
1490
1490
char * fn_name , cont_len [30 ];
1491
1491
int num_params = 0 , size , i , call_status = 0 ;
@@ -1760,8 +1760,6 @@ PHP_METHOD(SoapServer, handle)
1760
1760
}
1761
1761
}
1762
1762
1763
- doc_return = NULL ;
1764
-
1765
1763
/* Process soap headers */
1766
1764
if (soap_headers != NULL ) {
1767
1765
soapHeader * header = soap_headers ;
@@ -1913,8 +1911,6 @@ PHP_METHOD(SoapServer, handle)
1913
1911
sapi_add_header ("Content-Type: text/xml; charset=utf-8" , sizeof ("Content-Type: text/xml; charset=utf-8" )- 1 , 1 );
1914
1912
}
1915
1913
1916
- xmlFreeDoc (doc_return );
1917
-
1918
1914
if (zend_ini_long ("zlib.output_compression" , sizeof ("zlib.output_compression" ), 0 )) {
1919
1915
sapi_add_header ("Connection: close" , sizeof ("Connection: close" )- 1 , 1 );
1920
1916
} else {
@@ -1936,6 +1932,10 @@ PHP_METHOD(SoapServer, handle)
1936
1932
SOAP_GLOBAL (typemap ) = old_typemap ;
1937
1933
SOAP_GLOBAL (features ) = old_features ;
1938
1934
1935
+ if (doc_return ) {
1936
+ xmlFreeDoc (doc_return );
1937
+ }
1938
+
1939
1939
/* Free soap headers */
1940
1940
zval_ptr_dtor (& retval );
1941
1941
while (soap_headers != NULL ) {
0 commit comments