summaryrefslogtreecommitdiff
path: root/ext/soap
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-06-25 16:57:09 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-06-26 11:43:11 +0200
commit788a68900dc72e6d3cab60312fb07c20e9677a9c (patch)
tree3bd03225da542f7b3f2c4e9926d7f35b6d66603b /ext/soap
parent80958d0f90dfa9a48e92e81e027121ec091c9d03 (diff)
downloadphp-git-788a68900dc72e6d3cab60312fb07c20e9677a9c.tar.gz
Fix xml doc leak in soap
Diffstat (limited to 'ext/soap')
-rw-r--r--ext/soap/soap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index a74aaf7d15..61f98e9325 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -1485,7 +1485,7 @@ PHP_METHOD(SoapServer, handle)
int soap_version, old_soap_version;
sdlPtr old_sdl = NULL;
soapServicePtr service;
- xmlDocPtr doc_request=NULL, doc_return;
+ xmlDocPtr doc_request = NULL, doc_return = NULL;
zval function_name, *params, *soap_obj, retval;
char *fn_name, cont_len[30];
int num_params = 0, size, i, call_status = 0;
@@ -1760,8 +1760,6 @@ PHP_METHOD(SoapServer, handle)
}
}
- doc_return = NULL;
-
/* Process soap headers */
if (soap_headers != NULL) {
soapHeader *header = soap_headers;
@@ -1913,8 +1911,6 @@ PHP_METHOD(SoapServer, handle)
sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
}
- xmlFreeDoc(doc_return);
-
if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) {
sapi_add_header("Connection: close", sizeof("Connection: close")-1, 1);
} else {
@@ -1936,6 +1932,10 @@ fail:
SOAP_GLOBAL(typemap) = old_typemap;
SOAP_GLOBAL(features) = old_features;
+ if (doc_return) {
+ xmlFreeDoc(doc_return);
+ }
+
/* Free soap headers */
zval_ptr_dtor(&retval);
while (soap_headers != NULL) {