print portal: Plug a memory leak

Pointed out by Christian Persch.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1271
This commit is contained in:
Matthias Clasen 2018-08-15 23:13:15 +00:00
parent a01feae15b
commit 3c2aceba63

View File

@ -378,7 +378,7 @@ prepare_print_response (GDBusConnection *connection,
{
PortalData *portal = data;
guint32 response;
GVariant *options;
GVariant *options = NULL;
if (portal->response_signal_id != 0)
{
@ -427,6 +427,9 @@ prepare_print_response (GDBusConnection *connection,
else
portal->result = GTK_PRINT_OPERATION_RESULT_CANCEL;
if (options)
g_variant_unref (options);
if (portal->loop)
g_main_loop_quit (portal->loop);
}