Skip to content

Commit bcc5181

Browse files
committed
uri: Fix leak of parsed URI when assigning soft errors by reference fails
This is not reproducible, because the URI object will still be referenced by Lexbor’s mraw instance and then cleanly destroyed at the end of the request.
1 parent ebe5e29 commit bcc5181

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/uri/php_uri.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 2) PHPAPI void php_uri_instantiate_uri(
359359
}
360360

361361
if (pass_errors_by_ref_and_free(errors_zv, &errors) == FAILURE) {
362+
uri_parser->free_uri(uri);
362363
RETURN_THROWS();
363364
}
364365

0 commit comments

Comments
 (0)