From 808cad30f81bd98e7416f52a8a9337d088bd48eb Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 12 Dec 2020 17:56:16 +0000 Subject: tests: Fix some memory leaks This is enough to make many of the tests pass under gcc's AddressSanitizer. pixbuf-randomly-modified still fails when it cannot allocate more memory, and pixbuf-fail fails with memory allocation errors unless run with ASAN_OPTIONS=allocator_may_return_null=1. Signed-off-by: Simon McVittie --- tests/test-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-common.c b/tests/test-common.c index 8ce15dd08..27af94212 100644 --- a/tests/test-common.c +++ b/tests/test-common.c @@ -109,7 +109,7 @@ find_format (const gchar *filename, gchar **found_format) } } - g_free (extensions); + g_strfreev (extensions); if (retval) break; } @@ -296,6 +296,8 @@ add_test_for_all_images (const gchar *prefix, test_path = g_strconcat (prefix, "/", relative_path, NULL); g_test_add_data_func_full (test_path, g_object_ref (file), test_func, g_object_unref); + g_free (relative_path); + g_free (test_path); return; } -- cgit v1.2.1