Valgrind: fix "Mismatched free/delete" - test-kvp-frames etc.

- test-kvp-frames
- test-xml-account
- test-xml-transaction
- test-account-object
- test-group-vs-book
- test-lots
- test-query
- test-import-pending-matches

==30223== Mismatched free() / delete / delete []
==30223==    at 0x4846AFF: operator delete(void*, unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==30223==    by 0x4E370AA: guid_free (guid.cpp:116)
...
==30223==  Address 0x7ea4390 is 0 bytes inside a block of size 16 alloc'd
==30223==    at 0x4843828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==30223==    by 0x5032948: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==30223==    by 0x11603A: get_random_guid (test-engine-stuff.cpp:209)
...
This commit is contained in:
Richard Cohen 2023-06-08 16:24:37 +01:00
parent 72c907bc9a
commit 4018ff1722

View File

@ -204,12 +204,7 @@ get_random_time (void)
GncGUID*
get_random_guid(void)
{
GncGUID *ret;
ret = g_new(GncGUID, 1);
guid_replace(ret);
return ret;
return guid_new();
}
/* ========================================================== */