From 0450c16fdb74038480c028d3dcc8f31e8fe7816d Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 4 Apr 2024 19:19:38 +0200 Subject: [PATCH] cli-transaction: Do not double free transaction ops 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: https://github.com/flatpak/flatpak/issues/5763 Fixes: 6e3cc82a ("Fix memory leaks") Signed-off-by: Sebastian Wick --- app/flatpak-cli-transaction.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/flatpak-cli-transaction.c b/app/flatpak-cli-transaction.c index 181b169f..ee7030df 100644 --- a/app/flatpak-cli-transaction.c +++ b/app/flatpak-cli-transaction.c @@ -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");