gopenuriportal: Fix two memory leaks

This commit is contained in:
Julian Sparber 2024-09-25 15:54:44 +02:00
parent f6d7878a54
commit ef064d625b

View File

@ -249,6 +249,8 @@ open_call_done (GObject *source,
NULL); NULL);
g_object_set_data (G_OBJECT (task), "signal-id", GINT_TO_POINTER (signal_id)); g_object_set_data (G_OBJECT (task), "signal-id", GINT_TO_POINTER (signal_id));
} }
g_free (path);
} }
void void
@ -334,6 +336,7 @@ g_openuri_portal_open_file_async (GFile *file,
errsv = errno; errsv = errno;
if (fd == -1) if (fd == -1)
{ {
g_clear_object (&task);
g_task_report_new_error (NULL, callback, user_data, NULL, g_task_report_new_error (NULL, callback, user_data, NULL,
G_IO_ERROR, g_io_error_from_errno (errsv), G_IO_ERROR, g_io_error_from_errno (errsv),
"OpenURI portal is not available"); "OpenURI portal is not available");