gnucash stable: [guid.cpp] plug char* guid_to_string leak

Christopher Lam clam at code.gnucash.org
Tue Jun 16 07:19:42 EDT 2026


Updated	 via  https://github.com/Gnucash/gnucash/commit/368b2894 (commit)
	from  https://github.com/Gnucash/gnucash/commit/56467754 (commit)



commit 368b2894b52b0cdc386b8ec713d52367d190c5a9
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Jun 16 13:57:56 2026 +0800

    [guid.cpp] plug char* guid_to_string leak
    
    it seems unused however

diff --git a/libgnucash/engine/guid.cpp b/libgnucash/engine/guid.cpp
index 946f3c1d03..0bd359a450 100644
--- a/libgnucash/engine/guid.cpp
+++ b/libgnucash/engine/guid.cpp
@@ -300,14 +300,14 @@ gnc_string_to_guid (const GValue *src, GValue *dest)
 static void
 gnc_guid_to_string (const GValue *src, GValue *dest)
 {
-    const gchar *str;
+    gchar *str;
 
     g_return_if_fail (G_VALUE_HOLDS_STRING (dest) &&
                       GNC_VALUE_HOLDS_GUID (src));
 
     str = guid_to_string (gnc_value_get_guid (src));
 
-    g_value_set_string (dest, str);
+    g_value_take_string (dest, str);
 }
 
 G_DEFINE_BOXED_TYPE_WITH_CODE (GncGUID, gnc_guid, guid_copy, guid_free,



Summary of changes:
 libgnucash/engine/guid.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list