gnucash maint: Multiple changes pushed

Geert Janssens gjanssens at
Mon Sep 10 13:50:11 EDT 2018

Updated	 via (commit)
	 via (commit)
	from (commit)

commit 48b29f5e91b6bce411a10505ad08b657967ec222
Author: Geert Janssens <geert at>
Date:   Mon Sep 10 19:49:43 2018 +0200

    Fix memory leak in char* type KvpValue and fix improper uses
    The core issue was that the delete visitor was never called because its parameter
    type (char *) didn't match the boost::variant type (const char *).
    Fixing the visitor's parameter type also require a const_cast
    back to char * because that's what g_free takes as argument.
    The rest of this commit is merely fixing KvpValue instantiations that
    tried to create a char* KvpValue from a stack based const string instead
    of a heap allocated one. That would bomb out on calling the
    delete visitor.

commit b866d7d955f89d74ac31ea49167c95a9cdbc8899
Author: Geert Janssens <geert at>
Date:   Mon Sep 10 18:57:39 2018 +0200

    Plug memory leak in xaccSplitDestroy
    Splits were not marked for deletion if the transaction is read-only
    and the account is not marked for deletion yet. The net result is
    that split will not be freed later on.
    However xaccSplitDestroy is also called from a Transaction's do_destroy.
    At that point accounts are not necessarily marked for deletion yet (like
    is the case when a datafile is closed). This turned out to be a problem
    for invoice post transactions (which are also read only) and hence
    would cause memory to leak.

Summary of changes:
 libgnucash/app-utils/test/test-option-util.cpp         |  2 +-
 libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp |  2 +-
 libgnucash/backend/xml/sixtp-dom-parsers.cpp           |  2 +-
 libgnucash/engine/Split.c                              |  1 +
 libgnucash/engine/gnc-aqbanking-templates.cpp          | 12 ++++++------
 libgnucash/engine/kvp-value.cpp                        |  6 +++---
 libgnucash/engine/kvp-value.hpp                        |  2 +-
 libgnucash/engine/qofbook.cpp                          |  2 +-
 libgnucash/engine/test/test-kvp-frame.cpp              |  2 +-
 libgnucash/engine/test/utest-Transaction.cpp           |  4 ++--
 10 files changed, 18 insertions(+), 17 deletions(-)

More information about the gnucash-patches mailing list