Valgrind: fix "Mismatched free/delete" - test-query

==31803== Mismatched free() / delete / delete []
==31803==    at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==31803==    by 0x1198CB: make_trans_query (test-engine-stuff.cpp:2030)
==31803==    by 0x115898: test_trans_query(transaction_s*, void*) (test-query.cpp:40)
...
==31803==  Address 0x7fed160 is 0 bytes inside a block of size 16 alloc'd
==31803==    at 0x4843FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==31803==    by 0x4E3706E: guid_malloc (guid.cpp:106)
==31803==    by 0x4E370D5: guid_copy (guid.cpp:123)
==31803==    by 0x4E371E7: guid_new (guid.cpp:154)
==31803==    by 0x115D64: get_random_guid (test-engine-stuff.cpp:207)
==31803==    by 0x11984C: make_trans_query (test-engine-stuff.cpp:2023)
...
This commit is contained in:
Richard Cohen 2023-06-17 13:58:59 +01:00
parent 4018ff1722
commit e5a26e3c77

View File

@ -2027,7 +2027,7 @@ make_trans_query (Transaction *trans, TestQueryTypes query_types)
xaccQueryAddAccountGUIDMatch (q, list, QOF_GUID_MATCH_ANY, QOF_QUERY_AND);
for (node = list; node; node = node->next)
g_free (node->data);
guid_free (static_cast<GncGUID*>(node->data));
g_list_free (list);
}