diff --git a/libgnucash/backend/xml/sixtp-dom-parsers.cpp b/libgnucash/backend/xml/sixtp-dom-parsers.cpp index 4f62bebdb2..df4a7d2cf4 100644 --- a/libgnucash/backend/xml/sixtp-dom-parsers.cpp +++ b/libgnucash/backend/xml/sixtp-dom-parsers.cpp @@ -176,7 +176,10 @@ static KvpValue* dom_tree_to_gdate_kvp_value (xmlNodePtr node) { auto date = dom_tree_to_gdate (node); - return date ? new KvpValue {*date} : nullptr; + if (!date) return nullptr; + auto rv{new KvpValue {*date}}; + g_date_free (date); + return rv; } gboolean