From 3c0b051ab0f9855cf4650801c6d57d8e593a4dd4 Mon Sep 17 00:00:00 2001 From: Richard Cohen Date: Mon, 19 Jun 2023 16:51:22 +0100 Subject: [PATCH] Valgrind: fix "Mismatched free/delete" for gnc_print_time64, qof_print_date ... when called from guile e.g. test-transaction and lots of other tests - gchar will also get the char* typemap, by typedef reduction ==119964== Mismatched free() / delete / delete [] ==119964== at 0x4847A1F: operator delete[](void*) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==119964== by 0x669F3E4: _wrap_gnc_print_time64(scm_unused_struct*, scm_unused_struct*) (swig-engine.cpp:38533) ... ==119948== Mismatched free() / delete / delete [] ==119948== at 0x4847A1F: operator delete[](void*) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==119948== by 0x6F6B431: _wrap_qof_print_date(scm_unused_struct*) (swig-engine.cpp:39124) ... --- bindings/engine.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/engine.i b/bindings/engine.i index 186a0860a8..7e849af8bb 100644 --- a/bindings/engine.i +++ b/bindings/engine.i @@ -74,7 +74,7 @@ GLIST_HELPER_INOUT(PriceList, SWIGTYPE_p_GNCPrice); // TODO: free PriceList? GLIST_HELPER_INOUT(CommodityList, SWIGTYPE_p_gnc_commodity); -%typemap(newfree) gchar * "g_free($1);" +%typemap(newfree) char * "g_free($1);" /* These need to be here so that they are *before* the function declarations in the header files, some of which are included by