(cppcheck) Fix a possible memory leak

Patch by Aurimas Fišeras.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21200 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2011-08-21 19:42:34 +00:00
parent 73e9f51253
commit 8b3650e07f

View File

@ -1436,7 +1436,6 @@ get_random_transaction_with_currency(QofBook *book,
gint num;
gchar *numstr;
numstr = g_new0(gchar, 10);
if (!account_list)
{
account_list = gnc_account_get_descendants (gnc_book_get_root_account (book));
@ -1450,6 +1449,8 @@ get_random_transaction_with_currency(QofBook *book,
return NULL;
}
numstr = g_new0(gchar, 10);
trans = xaccMallocTransaction(book);
xaccTransBeginEdit(trans);