gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Wed Jun 2 09:37:05 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/f33b2810 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fc67b03e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d79b2ea3 (commit)
	from  https://github.com/Gnucash/gnucash/commit/b3101c93 (commit)



commit f33b281046ff01df611305ca8dbb51a7c20c23bb
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Jun 2 21:26:38 2021 +0800

    [dialog-payment] xaccTransGetAPARAcctSplitList must be freed

diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c
index ab3a33ddd..3aea0be60 100644
--- a/gnucash/gnome/dialog-payment.c
+++ b/gnucash/gnome/dialog-payment.c
@@ -1688,6 +1688,8 @@ static GList *select_txn_lots (GtkWindow *parent, Transaction *txn, Account **po
         }
     }
 
+    g_list_free (post_splits);
+
     /* If the txn has both APAR splits linked to a business lot and
      * splits that are not, issue a warning some will be discarded.
      */
@@ -1726,6 +1728,8 @@ static GList *select_txn_lots (GtkWindow *parent, Transaction *txn, Account **po
         g_free (split_str);
     }
 
+    g_list_free (no_lot_post_splits);
+
     return txn_lots;
 }
 

commit fc67b03e5c2568496bf7507e0aea0a3e7af514f4
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Jun 2 20:21:27 2021 +0800

    [gnc-plugin-page-register] xaccTransGetAPARAcctSplitList must be freed

diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 797b2959d..a6462b7aa 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -4697,14 +4697,18 @@ static GncInvoice* invoice_from_split (Split* split)
 GList* invoices_from_transaction (Transaction* trans)
 {
     GList *invoices = NULL;
+    GList *apar_splits;
     if (!trans) return NULL;
 
-    for (GList *node = xaccTransGetAPARAcctSplitList(trans, TRUE); node;
-         node = node->next)
+    apar_splits = xaccTransGetAPARAcctSplitList (trans, TRUE);
+    if (!apar_splits) return NULL;
+
+    for (GList *node = apar_splits; node; node = node->next)
     {
         GncInvoice* inv = invoice_from_split ((Split*) node->data);
         if (inv) invoices = g_list_prepend (invoices, inv);
     }
+    g_list_free (apar_splits);
     return invoices;
 }
 

commit d79b2ea3715f7e9751a4196fd66915d91bebbb38
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Jun 2 20:30:16 2021 +0800

    [gnc-icons] g_build_filename needs to be g_freed

diff --git a/gnucash/gnome-utils/gnc-icons.c b/gnucash/gnome-utils/gnc-icons.c
index 313413f54..1cbe2483f 100644
--- a/gnucash/gnome-utils/gnc-icons.c
+++ b/gnucash/gnome-utils/gnc-icons.c
@@ -64,7 +64,7 @@ void
 gnc_load_app_icons (void)
 {
     GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
-    const gchar *default_path;
+    gchar *default_path;
     gchar* pkgdatadir = gnc_path_get_pkgdatadir ();
     gchar* datadir = gnc_path_get_datadir ();
     gchar **path;
@@ -72,8 +72,10 @@ gnc_load_app_icons (void)
 
     default_path = g_build_filename (pkgdatadir, "icons", NULL);
     gtk_icon_theme_append_search_path (icon_theme, default_path);
+    g_free (default_path);
     default_path = g_build_filename (datadir, "icons", NULL);
     gtk_icon_theme_append_search_path (icon_theme, default_path);
+    g_free (default_path);
     g_free (pkgdatadir);
     g_free (datadir);
 



Summary of changes:
 gnucash/gnome-utils/gnc-icons.c          | 4 +++-
 gnucash/gnome/dialog-payment.c           | 4 ++++
 gnucash/gnome/gnc-plugin-page-register.c | 8 ++++++--
 3 files changed, 13 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list