Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ext/uri/php_uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_uri_get_fragment(const uri_interna

ZEND_ATTRIBUTE_NONNULL PHPAPI void php_uri_free(uri_internal_t *internal_uri)
{
internal_uri->parser->free(internal_uri->uri);
internal_uri->parser->destroy(internal_uri->uri);
internal_uri->uri = NULL;
internal_uri->parser = NULL;
efree(internal_uri);
Expand Down Expand Up @@ -366,7 +366,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 2) PHPAPI void php_uri_instantiate_uri(
}

if (pass_errors_by_ref_and_free(errors_zv, &errors) == FAILURE) {
uri_parser->free(uri);
uri_parser->destroy(uri);
RETURN_THROWS();
}

Expand Down Expand Up @@ -1045,7 +1045,7 @@ PHPAPI void php_uri_object_handler_free(zend_object *object)
{
uri_object_t *uri_object = uri_object_from_obj(object);

uri_object->internal.parser->free(uri_object->internal.uri);
uri_object->internal.parser->destroy(uri_object->internal.uri);
zend_object_std_dtor(&uri_object->std);
}

Expand Down Expand Up @@ -1077,7 +1077,7 @@ PHPAPI zend_result php_uri_parser_register(const php_uri_parser *uri_parser)
ZEND_ASSERT(uri_parser->parse != NULL);
ZEND_ASSERT(uri_parser->clone != NULL || strcmp(uri_parser->name, PHP_URI_PARSER_PHP_PARSE_URL) == 0);
ZEND_ASSERT(uri_parser->to_string != NULL || strcmp(uri_parser->name, PHP_URI_PARSER_PHP_PARSE_URL) == 0);
ZEND_ASSERT(uri_parser->free != NULL);
ZEND_ASSERT(uri_parser->destroy != NULL);

zend_result result = zend_hash_add_ptr(&uri_parsers, key, (void *) uri_parser) != NULL ? SUCCESS : FAILURE;

Expand Down
4 changes: 2 additions & 2 deletions ext/uri/php_uri_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ typedef struct php_uri_parser {
zend_string *(*to_string)(void *uri, php_uri_recomposition_mode recomposition_mode, bool exclude_fragment);

/**
* Frees the provided URI.
* Destroy (free) the provided URI.
*
* @param uri The URI to free. Must do nothing if NULL.
*/
void (*free)(void *uri);
void (*destroy)(void *uri);

struct {
php_uri_property_handler scheme;
Expand Down
4 changes: 2 additions & 2 deletions ext/uri/uri_parser_php_parse_url.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static void *uri_parser_php_parse_url_parse(const char *uri_str, size_t uri_str_
return url;
}

static void uri_parser_php_parse_url_free(void *uri)
static void uri_parser_php_parse_url_destroy(void *uri)
{
php_url *parse_url_uri = uri;

Expand All @@ -170,7 +170,7 @@ const php_uri_parser php_uri_parser_php_parse_url = {
.parse = uri_parser_php_parse_url_parse,
.clone = NULL,
.to_string = NULL,
.free = uri_parser_php_parse_url_free,
.destroy = uri_parser_php_parse_url_destroy,
{
.scheme = {.read = uri_parser_php_parse_url_scheme_read, .write = NULL},
.username = {.read = uri_parser_php_parse_url_username_read, .write = NULL},
Expand Down
8 changes: 4 additions & 4 deletions ext/uri/uri_parser_rfc3986.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void *php_uri_parser_rfc3986_memory_manager_reallocarray(UriMemoryManager
return safe_erealloc(ptr, nmemb, size, 0);
}

static void php_uri_parser_rfc3986_memory_manager_free(UriMemoryManager *memory_manager, void *ptr)
static void php_uri_parser_rfc3986_memory_manager_destroy(UriMemoryManager *memory_manager, void *ptr)
{
efree(ptr);
}
Expand All @@ -50,7 +50,7 @@ static const UriMemoryManager php_uri_parser_rfc3986_memory_manager = {
.calloc = php_uri_parser_rfc3986_memory_manager_calloc,
.realloc = php_uri_parser_rfc3986_memory_manager_realloc,
.reallocarray = php_uri_parser_rfc3986_memory_manager_reallocarray,
.free = php_uri_parser_rfc3986_memory_manager_free,
.free = php_uri_parser_rfc3986_memory_manager_destroy,
.userData = NULL,
};

Expand Down Expand Up @@ -593,7 +593,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_string *php_uri_parser_rfc3986_to_string(void
return uri_string;
}

static void php_uri_parser_rfc3986_free(void *uri)
static void php_uri_parser_rfc3986_destroy(void *uri)
{
php_uri_parser_rfc3986_uris *uriparser_uris = uri;

Expand All @@ -612,7 +612,7 @@ const php_uri_parser php_uri_parser_rfc3986 = {
.parse = php_uri_parser_rfc3986_parse,
.clone = php_uri_parser_rfc3986_clone,
.to_string = php_uri_parser_rfc3986_to_string,
.free = php_uri_parser_rfc3986_free,
.destroy = php_uri_parser_rfc3986_destroy,
{
.scheme = {.read = php_uri_parser_rfc3986_scheme_read, .write = php_uri_parser_rfc3986_scheme_write},
.username = {.read = php_uri_parser_rfc3986_username_read, .write = NULL},
Expand Down
4 changes: 2 additions & 2 deletions ext/uri/uri_parser_whatwg.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ static zend_string *php_uri_parser_whatwg_to_string(void *uri, php_uri_recomposi
return smart_str_extract(&uri_str);
}

static void php_uri_parser_whatwg_free(void *uri)
static void php_uri_parser_whatwg_destroy(void *uri)
{
lxb_url_t *lexbor_uri = uri;

Expand All @@ -626,7 +626,7 @@ const php_uri_parser php_uri_parser_whatwg = {
.parse = php_uri_parser_whatwg_parse,
.clone = php_uri_parser_whatwg_clone,
.to_string = php_uri_parser_whatwg_to_string,
.free = php_uri_parser_whatwg_free,
.destroy = php_uri_parser_whatwg_destroy,
{
.scheme = {.read = php_uri_parser_whatwg_scheme_read, .write = php_uri_parser_whatwg_scheme_write},
.username = {.read = php_uri_parser_whatwg_username_read, .write = php_uri_parser_whatwg_username_write},
Expand Down