Skip to content

Commit

Permalink
open-uri: Fix leaking GVariantBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
swick committed Nov 1, 2024
1 parent f8ed058 commit f95c87d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/open-uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,12 @@ send_response_in_thread_func (GTask *task,
guint response;
GVariant *options;
const char *choice;
GVariantBuilder opt_builder;

REQUEST_AUTOLOCK (request);

response = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (request), "response"));
options = (GVariant *)g_object_get_data (G_OBJECT (request), "options");

g_variant_builder_init (&opt_builder, G_VARIANT_TYPE_VARDICT);

if (response != 0)
goto out;

Expand Down Expand Up @@ -390,6 +387,9 @@ send_response_in_thread_func (GTask *task,
out:
if (request->exported)
{
g_auto(GVariantBuilder) opt_builder =
G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE_VARDICT);

xdp_dbus_request_emit_response (XDP_DBUS_REQUEST (request),
response,
g_variant_builder_end (&opt_builder));
Expand Down

0 comments on commit f95c87d

Please sign in to comment.