Skip to content

Commit

Permalink
cli-transaction: Do not double free transaction ops
Browse files Browse the repository at this point in the history
The transaction ops are a g_autolist(FlatpakTransactionOperation) which
means the list gets freed automatically. Calling g_list_free_full
without clearing the variable to NULL results in a double-free.

Closes: #5763
Fixes: 6e3cc82 ("Fix memory leaks")
Signed-off-by: Sebastian Wick <[email protected]>
  • Loading branch information
swick authored and GeorgesStavracas committed Apr 4, 2024
1 parent f1088e3 commit 0450c16
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/flatpak-cli-transaction.c
Expand Up @@ -1467,10 +1467,7 @@ transaction_ready_pre_auth (FlatpakTransaction *transaction)
ret = flatpak_yes_no_prompt (TRUE, _("Proceed with these changes to the %s?"), name);

if (!ret)
{
g_list_free_full (ops, g_object_unref);
return FALSE;
}
return FALSE;
}
else
g_print ("\n\n");
Expand Down

0 comments on commit 0450c16

Please sign in to comment.