From f21f4f42640ebda5545201534502aa7f4de9b488 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Mon, 15 Apr 2024 22:10:05 +0800 Subject: [PATCH] [gnc-autoclear.c] tidy xaccAccountGetSplitList because acc_splits will need to be g_list_free in a future commit --- gnucash/gnome-utils/gnc-autoclear.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnucash/gnome-utils/gnc-autoclear.c b/gnucash/gnome-utils/gnc-autoclear.c index b2c249d744..0b4ff9249d 100644 --- a/gnucash/gnome-utils/gnc-autoclear.c +++ b/gnucash/gnome-utils/gnc-autoclear.c @@ -122,7 +122,8 @@ gnc_autoclear_get_splits (Account *account, gnc_numeric toclear_value, DUP_LIST = g_list_prepend (NULL, NULL); /* Extract which splits are not cleared and compute the amount we have to clear */ - for (GList *node = xaccAccountGetSplitList (account); node; node = node->next) + GList *acc_splits = xaccAccountGetSplitList (account); + for (GList *node = acc_splits; node; node = node->next) { Split *split = (Split *)node->data; gnc_numeric amount = xaccSplitGetAmount (split);