Bug 798221 - Transfer funds between accounts with different currencies crashes Gnucash on macOS

In the scrub function find_account_matching_name_in_list there was a
test for account names being the same for currency but condition was
backwards so was matching on account names being different. There was
also a g_list_free resulting in a double free which was removed.
This commit is contained in:
Robert Fewell 2021-07-08 09:33:10 +01:00
parent 38c0163431
commit 0f026f6a10

View File

@ -1434,11 +1434,8 @@ find_account_matching_name_in_list (GList *acc_list, const char* accname)
{
Account *acc = GNC_ACCOUNT (node->data);
if (G_UNLIKELY (!acc)) continue;
if (g_strcmp0 (accname, xaccAccountGetName(acc)))
{
g_list_free (acc_list);
if (g_strcmp0 (accname, xaccAccountGetName (acc)) == 0)
return acc;
}
}
return NULL;
}