gnucash maint: GncGUIDs should be freed with guid_free instead of g_free

Christopher Lam clam at code.gnucash.org
Mon May 17 09:03:40 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/c1cb29df (commit)
	from  https://github.com/Gnucash/gnucash/commit/072f3ac1 (commit)



commit c1cb29df53a969a318597e20b528bfc637cf380c
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon May 17 21:00:30 2021 +0800

    GncGUIDs should be freed with guid_free instead of g_free

diff --git a/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp b/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp
index f396f640c..1429a7106 100644
--- a/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp
+++ b/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp
@@ -216,7 +216,7 @@ sx_id_handler (xmlNodePtr node, gpointer sx_pdata)
 
     g_return_val_if_fail (tmp, FALSE);
     xaccSchedXactionSetGUID (sx, tmp);
-    g_free (tmp);
+    guid_free (tmp);
 
     return TRUE;
 }
diff --git a/libgnucash/backend/xml/io-gncxml-v1.cpp b/libgnucash/backend/xml/io-gncxml-v1.cpp
index af0177b58..a731b421a 100644
--- a/libgnucash/backend/xml/io-gncxml-v1.cpp
+++ b/libgnucash/backend/xml/io-gncxml-v1.cpp
@@ -2936,7 +2936,7 @@ price_parse_xml_sub_node (GNCPrice* p, xmlNodePtr sub_node, QofBook* book)
         GncGUID* c = dom_tree_to_guid (sub_node);
         if (!c) return FALSE;
         gnc_price_set_guid (p, c);
-        g_free (c);
+        guid_free (c);
     }
     else if (g_strcmp0 ("price:commodity", (char*)sub_node->name) == 0)
     {



Summary of changes:
 libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp | 2 +-
 libgnucash/backend/xml/io-gncxml-v1.cpp            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list