Bug 798435 - Crash on print after printing checks

bug in 0a22f688a - splits gets a pointer to the QofQuery output and
must not be freed
This commit is contained in:
Christopher Lam 2022-01-26 13:20:17 +08:00
parent 22a1c354f7
commit 3c0dfb2741

View File

@ -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
{