Fix persistent leak on load_wsdl_ex failure

Move the load_wsdl_ex call into the zend_try that destroys the
docs hash table. The wsdl will be inserted into docs early on,
and will thus be released on subsequent bailout.
This commit is contained in:
Nikita Popov 2021-02-02 10:05:35 +01:00
parent 675a9b2831
commit 51d76c346e

View file

@ -741,9 +741,8 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
zend_hash_init(&ctx.portTypes, 0, NULL, NULL, 0);
zend_hash_init(&ctx.services, 0, NULL, NULL, 0);
load_wsdl_ex(this_ptr, struri, &ctx, 0);
zend_try {
load_wsdl_ex(this_ptr, struri, &ctx, 0);
schema_pass2(&ctx);
n = zend_hash_num_elements(&ctx.services);