Skip to content

Commit

Permalink
session-helper: Don't leak the GOptionContext
Browse files Browse the repository at this point in the history
Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv committed Feb 15, 2024
1 parent a96834b commit 7663b51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions session-helper/flatpak-session-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ main (int argc,
gboolean replace;
gboolean verbose;
gboolean show_version;
GOptionContext *context;
g_autoptr(GOptionContext) context = NULL;
GBusNameOwnerFlags flags;
g_autofree char *pk11_program = NULL;
g_autofree char *flatpak_dir = NULL;
Expand Down Expand Up @@ -821,10 +821,11 @@ main (int argc,
g_printerr ("Try \"%s --help\" for more information.",
g_get_prgname ());
g_printerr ("\n");
g_option_context_free (context);
return 1;
}

g_clear_pointer (&context, g_option_context_free);

if (show_version)
{
g_print (PACKAGE_STRING "\n");
Expand Down

0 comments on commit 7663b51

Please sign in to comment.