From 9347c7630f2e504685a0de4f5b1ebf82dba31505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Thu, 1 Nov 2018 00:00:00 +0000 Subject: [PATCH 1/3] tests: Fix GRand leak in GMenuModel tests --- gio/tests/gmenumodel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gio/tests/gmenumodel.c b/gio/tests/gmenumodel.c index 5d6f485c4..53e701360 100644 --- a/gio/tests/gmenumodel.c +++ b/gio/tests/gmenumodel.c @@ -1160,6 +1160,8 @@ do_modify (gpointer data) random_menu_change (menu, rand); } + g_rand_free (rand); + return NULL; } @@ -1201,9 +1203,11 @@ test_dbus_threaded (void) for (i = 0; i < 10; i++) { - menu[i] = random_menu_new (g_rand_new_with_seed (g_test_rand_int ()), 2); + GRand *rand = g_rand_new_with_seed (g_test_rand_int ()); + menu[i] = random_menu_new (rand, 2); call[i] = g_thread_new ("call", do_modify, menu[i]); export[i] = g_thread_new ("export", do_export, menu[i]); + g_rand_free (rand); } for (i = 0; i < 10; i++) From 52bab0254a389cafde18c23df05f6f92b4a5c3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Thu, 1 Nov 2018 00:00:00 +0000 Subject: [PATCH 2/3] tests: Fix GOptionContext leak in GSubprocess tests --- gio/tests/gsubprocess-testprog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gio/tests/gsubprocess-testprog.c b/gio/tests/gsubprocess-testprog.c index 74cb9e2a3..8d032540c 100644 --- a/gio/tests/gsubprocess-testprog.c +++ b/gio/tests/gsubprocess-testprog.c @@ -205,10 +205,13 @@ main (int argc, char **argv) g_option_context_add_main_entries (context, options, NULL); if (!g_option_context_parse (context, &argc, &argv, &error)) { + g_option_context_free (context); g_printerr ("%s: %s\n", argv[0], error->message); return 1; } + g_option_context_free (context); + if (argc < 2) { g_printerr ("MODE argument required\n"); From b7571d5f0f951309c4680745e8c8f500a62dda2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Thu, 1 Nov 2018 00:00:00 +0000 Subject: [PATCH 3/3] tests: Fix GVariantType leak in GAction tests --- gio/tests/actions.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gio/tests/actions.c b/gio/tests/actions.c index 8b5339e4d..4c7cd3a05 100644 --- a/gio/tests/actions.c +++ b/gio/tests/actions.c @@ -1040,6 +1040,8 @@ test_property_actions (void) g_assert_cmpstr (name, ==, "keepalive"); g_assert (enabled); g_free (name); + g_variant_type_free (ptype); + g_variant_type_free (stype); g_variant_unref (state); g_action_map_add_action (G_ACTION_MAP (group), G_ACTION (action));