Do not use g_autofree

The g_auto macros are available only with GCC-compatible compilers on
Unix, but having __attribute__((cleanup)) is not part of our toolchain
requirements, so we shouldn't use it — even if we are building on
Unix-compatible systems.

https://bugzilla.gnome.org/show_bug.cgi?id=794732
This commit is contained in:
Emmanuele Bassi 2018-03-27 16:06:54 +01:00
parent 1180649a08
commit 07731ff3fc
2 changed files with 6 additions and 2 deletions

View File

@ -2886,7 +2886,7 @@ g_desktop_app_info_launch_uris_with_dbus (GDesktopAppInfo *info,
GAppLaunchContext *launch_context)
{
GList *ruris = uris;
g_autofree char *app_id = NULL;
char *app_id = NULL;
g_return_val_if_fail (info != NULL, FALSE);
@ -2905,6 +2905,8 @@ g_desktop_app_info_launch_uris_with_dbus (GDesktopAppInfo *info,
if (ruris != uris)
g_list_free_full (ruris, g_free);
g_free (app_id);
return TRUE;
}

View File

@ -203,7 +203,7 @@ g_document_portal_add_documents (GList *uris,
{
const char *uri = l->data;
int idx = -1;
g_autofree char *path = NULL;
char *path = NULL;
path = g_filename_from_uri (uri, NULL, NULL);
if (path != NULL)
@ -221,6 +221,8 @@ g_document_portal_add_documents (GList *uris,
}
}
g_free (path);
if (idx != -1)
g_variant_builder_add (&builder, "h", idx);
else