gnucash maint: Bug 798435 - Crash on print after printing checks

Christopher Lam clam at code.gnucash.org
Wed Jan 26 00:22:05 EST 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/3c0dfb27 (commit)
	from  https://github.com/Gnucash/gnucash/commit/22a1c354 (commit)



commit 3c0dfb2741d8a8e02c9d63f790127b1c7cd8bb79
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Jan 26 13:20:17 2022 +0800

    Bug 798435 - Crash on print after printing checks
    
    bug in 0a22f688a - splits gets a pointer to the QofQuery output and
    must not be freed

diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 989593cef..80221d19e 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -3744,7 +3744,10 @@ gnc_plugin_page_register_cmd_print_check (GtkAction* action,
     else if (ledger_type == LD_GL && reg->type == SEARCH_LEDGER)
     {
         Account* common_acct = NULL;
+
+        /* the following GList* splits must not be freed */
         splits = qof_query_run (gnc_ledger_display_get_query (priv->ledger));
+
         /* Make sure each split is from the same account */
         for (item = splits; item; item = g_list_next (item))
         {
@@ -3786,7 +3789,6 @@ gnc_plugin_page_register_cmd_print_check (GtkAction* action,
             }
         }
         gnc_ui_print_check_dialog_create (window, splits);
-        g_list_free (splits);
     }
     else
     {



Summary of changes:
 gnucash/gnome/gnc-plugin-page-register.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list