1
0
Fork 0

tests/test-runner: Don't leak tests array

Make sure we properly free the array and its string elements

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2817>
This commit is contained in:
Niels De Graef 2023-01-31 09:43:12 +01:00 committed by Marge Bot
parent 1a814250c0
commit 019267a044

View file

@ -1430,7 +1430,7 @@ int
main (int argc, char **argv)
{
g_autoptr (MetaContext) context = NULL;
GPtrArray *tests;
g_autoptr (GPtrArray) tests = NULL;
RunTestsInfo info;
context = meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
@ -1440,7 +1440,7 @@ main (int argc, char **argv)
g_assert (meta_context_configure (context, &argc, &argv, NULL));
tests = g_ptr_array_new ();
tests = g_ptr_array_new_with_free_func (g_free);
if (all_tests)
{
GFile *test_dir = g_file_new_for_path (MUTTER_PKGDATADIR "/tests");