gnucash stable: [gnc-ui-util.c] plug GList* leak

Christopher Lam clam at code.gnucash.org
Tue Aug 8 08:00:18 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/e91752db (commit)
	from  https://github.com/Gnucash/gnucash/commit/b2273a1e (commit)



commit e91752dba2be30983d14355de74d258cce165ac4
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Aug 8 19:43:06 2023 +0800

    [gnc-ui-util.c] plug GList* leak
    
    because gnc_account_get_children should have been freed.

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"



Summary of changes:
 libgnucash/app-utils/gnc-ui-util.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)



More information about the gnucash-changes mailing list