From e91752dba2be30983d14355de74d258cce165ac4 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Tue, 8 Aug 2023 19:43:06 +0800 Subject: [PATCH] [gnc-ui-util.c] plug GList* leak because gnc_account_get_children should have been freed. --- libgnucash/app-utils/gnc-ui-util.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libgnucash/app-utils/gnc-ui-util.c b/libgnucash/app-utils/gnc-ui-util.c index 025b9b6e21..ed17ae8d9c 100644 --- a/libgnucash/app-utils/gnc-ui-util.c +++ b/libgnucash/app-utils/gnc-ui-util.c @@ -224,12 +224,8 @@ gnc_get_current_book (void) gboolean gnc_is_new_book (void) { - return ((!gnc_current_session_exist() || - (gnc_current_session_exist() && - !gnc_account_get_children( - gnc_book_get_root_account( - gnc_get_current_book())))) - ? TRUE : FALSE); + return (!gnc_current_session_exist() || + gnc_account_n_children (gnc_book_get_root_account (gnc_get_current_book ())) == 0); } #define OPTION_TAXUS_NAME "tax_US/name"