gnucash maint: [gnc-budget-view] g_free a newly allocated gchar*

Christopher Lam clam at code.gnucash.org
Wed Jan 5 03:23:23 EST 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/38578971 (commit)
	from  https://github.com/Gnucash/gnucash/commit/32cfd484 (commit)



commit 3857897181e8462809a3ecc5a57fc22a81112639
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Jan 5 16:15:12 2022 +0800

    [gnc-budget-view] g_free a newly allocated gchar*

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index ad95a9936..c646f7b92 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -1100,7 +1100,7 @@ budget_col_source (Account *account, GtkTreeViewColumn *col,
     guint period_num;
     gnc_numeric numeric;
     gchar amtbuff[100]; //FIXME: overkill, where's the #define?
-    const gchar *note;
+    gchar *note;
 
     budget_view = GNC_BUDGET_VIEW(g_object_get_data (G_OBJECT(col), "budget_view"));
     period_num = GPOINTER_TO_UINT(g_object_get_data (G_OBJECT(col), "period_num"));
@@ -1160,6 +1160,7 @@ budget_col_source (Account *account, GtkTreeViewColumn *col,
 
     note = gnc_budget_get_account_period_note (priv->budget, account, period_num);
     g_object_set (cell, "flagged", note != NULL, NULL);
+    g_free (note);
 
     return g_strdup (amtbuff);
 }



Summary of changes:
 gnucash/gnome/gnc-budget-view.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list