gnucash stable: [gnc-pricedb.cpp] plug leak from gnc_g_date_new_today
Christopher Lam
clam at code.gnucash.org
Fri Jul 4 00:01:20 EDT 2025
Updated via https://github.com/Gnucash/gnucash/commit/368b74c6 (commit)
from https://github.com/Gnucash/gnucash/commit/f3f917df (commit)
commit 368b74c69c7a749710cfe350f985d2de39d08d3b
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Jul 4 11:52:09 2025 +0800
[gnc-pricedb.cpp] plug leak from gnc_g_date_new_today
diff --git a/libgnucash/engine/gnc-pricedb.cpp b/libgnucash/engine/gnc-pricedb.cpp
index ae42a8409b..83c317b63b 100644
--- a/libgnucash/engine/gnc-pricedb.cpp
+++ b/libgnucash/engine/gnc-pricedb.cpp
@@ -1592,13 +1592,17 @@ gnc_pricedb_remove_old_prices (GNCPriceDB *db, GList *comm_list,
// Check for a valid fiscal end of year date
if (fiscal_end_date == nullptr)
{
- GDateYear year_now = g_date_get_year (gnc_g_date_new_today ());
+ GDate today;
+ gnc_gdate_set_today (&today);
+ GDateYear year_now = g_date_get_year (&today);
fiscal_end_date = g_date_new ();
g_date_set_dmy (fiscal_end_date, 31, GDateMonth(12), year_now);
}
else if (g_date_valid (fiscal_end_date) == FALSE)
{
- GDateYear year_now = g_date_get_year (gnc_g_date_new_today ());
+ GDate today;
+ gnc_gdate_set_today (&today);
+ GDateYear year_now = g_date_get_year (&today);
g_date_clear (fiscal_end_date, 1);
g_date_set_dmy (fiscal_end_date, 31, GDateMonth(12), year_now);
}
Summary of changes:
libgnucash/engine/gnc-pricedb.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
More information about the gnucash-changes
mailing list