diff options
author | Corentin Noël <corentin.noel@collabora.com> | 2021-10-06 18:35:29 +0200 |
---|---|---|
committer | Corentin Noël <tintou@noel.tf> | 2022-04-09 00:44:24 +0200 |
commit | c2df7447154f5e633432a1c192ddd162055e3958 (patch) | |
tree | a546bca01a3700fbc36d5fd4ccca6b0ddc543952 /gck/gck-uri.c | |
parent | e2e3c17ef45347d91dfc66bc1c5c451af0774d8e (diff) | |
download | gcr-c2df7447154f5e633432a1c192ddd162055e3958.tar.gz |
gck: use the right namespace for GckUriData methods
Diffstat (limited to 'gck/gck-uri.c')
-rw-r--r-- | gck/gck-uri.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/gck/gck-uri.c b/gck/gck-uri.c index e0c3faf..3cc0dc8 100644 --- a/gck/gck-uri.c +++ b/gck/gck-uri.c @@ -132,11 +132,11 @@ gck_uri_error_get_quark (void) GckUriData * gck_uri_data_new (void) { - return g_slice_new0 (GckUriData); + return g_new0 (GckUriData, 1); } /** - * gck_uri_parse: + * gck_uri_data_parse: * @string: the URI to parse. * @flags: the context in which the URI will be used. * @error: a #GError, or %NULL. @@ -151,7 +151,7 @@ gck_uri_data_new (void) * freed with gck_uri_data_free() */ GckUriData* -gck_uri_parse (const gchar *string, GckUriFlags flags, GError **error) +gck_uri_data_parse (const gchar *string, GckUriFlags flags, GError **error) { GckUriData *uri_data = NULL; GckBuilder builder; @@ -217,7 +217,7 @@ gck_uri_parse (const gchar *string, GckUriFlags flags, GError **error) } /** - * gck_uri_build: + * gck_uri_data_build: * @uri_data: the info to build the URI from. * @flags: The context that the URI is for * @@ -227,7 +227,7 @@ gck_uri_parse (const gchar *string, GckUriFlags flags, GError **error) * Return value: a newly allocated string containing a PKCS#11 URI. */ gchar* -gck_uri_build (GckUriData *uri_data, GckUriFlags flags) +gck_uri_data_build (GckUriData *uri_data, GckUriFlags flags) { const GckAttribute *attr; P11KitUri *p11_uri = 0; @@ -298,13 +298,11 @@ gck_uri_data_copy (GckUriData *uri_data) void gck_uri_data_free (GckUriData *uri_data) { - if (uri_data) { - if (uri_data->attributes) - gck_attributes_unref (uri_data->attributes); - if (uri_data->module_info) - gck_module_info_free (uri_data->module_info); - if (uri_data->token_info) - gck_token_info_free (uri_data->token_info); - g_slice_free (GckUriData, uri_data); - } + if (!uri_data) + return; + + g_clear_pointer (&uri_data->attributes, gck_attributes_unref); + g_clear_pointer (&uri_data->module_info, gck_module_info_free); + g_clear_pointer (&uri_data->token_info, gck_token_info_free); + g_free (uri_data); } |