Skip to content

Commit

Permalink
Fix persistent leak on load_wsdl_ex failure
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikic committed Feb 2, 2021
1 parent 675a9b2 commit 51d76c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ext/soap/php_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 51d76c3

Please sign in to comment.