Skip to content

Commit

Permalink
Always initialize g_auto(GVariantBuilder)
Browse files Browse the repository at this point in the history
  • Loading branch information
swick authored and GeorgesStavracas committed Nov 5, 2024
1 parent 776d48a commit 89a2e21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/email.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,12 @@ handle_compose_email (XdpDbusEmail *object,
const char *app_id = xdp_app_info_get_id (request->app_info);
g_autoptr(GError) error = NULL;
g_autoptr(XdpDbusImplRequest) impl_request = NULL;
g_auto(GVariantBuilder) options;
g_auto(GVariantBuilder) options =
G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE_VARDICT);
g_autoptr(GVariant) attachment_fds = NULL;

g_debug ("Handling ComposeEmail");

g_variant_builder_init (&options, G_VARIANT_TYPE_VARDICT);

REQUEST_AUTOLOCK (request);

impl_request = xdp_dbus_impl_request_proxy_new_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (impl)),
Expand Down
13 changes: 6 additions & 7 deletions src/global-shortcuts.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ handle_create_session (XdpDbusGlobalShortcuts *object,
Request *request = request_from_invocation (invocation);
g_autoptr(GError) error = NULL;
g_autoptr(XdpDbusImplRequest) impl_request = NULL;
g_auto(GVariantBuilder) options_builder;
g_auto(GVariantBuilder) options_builder =
G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE_VARDICT);
g_autoptr(GVariant) options = NULL;
Session *session;

REQUEST_AUTOLOCK (request);

g_variant_builder_init (&options_builder, G_VARIANT_TYPE_VARDICT);
if (!xdp_filter_options (arg_options, &options_builder,
global_shortcuts_create_session_options,
G_N_ELEMENTS (global_shortcuts_create_session_options),
Expand Down Expand Up @@ -388,14 +388,13 @@ handle_bind_shortcuts (XdpDbusGlobalShortcuts *object,
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) options = NULL;
g_autoptr(GVariant) shortcuts = NULL;
g_auto(GVariantBuilder) shortcuts_builder;
g_auto(GVariantBuilder) options_builder;
g_auto(GVariantBuilder) shortcuts_builder =
G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE_ARRAY);
g_auto(GVariantBuilder) options_builder =
G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE_VARDICT);

REQUEST_AUTOLOCK (request);

g_variant_builder_init (&shortcuts_builder, G_VARIANT_TYPE_ARRAY);
g_variant_builder_init (&options_builder, G_VARIANT_TYPE_VARDICT);

if (!xdp_filter_options (arg_options, &options_builder,
global_shortcuts_bind_shortcuts_options,
G_N_ELEMENTS (global_shortcuts_bind_shortcuts_options),
Expand Down

0 comments on commit 89a2e21

Please sign in to comment.