tests: Fix a double-free in param test

This isn’t normally hit because it’s in a test which is disabled unless
run with `-m thorough`.

The data is owned by `g_test_add_data_func_full()` until the end of the
process.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-01-18 16:54:01 +00:00
parent d738dcc76f
commit a4b9b41afc

View File

@ -1670,8 +1670,7 @@ main (int argc, char *argv[])
data.change_this_flag, data.change_this_type,
data.use_this_flag, data.use_this_type);
test_data = g_memdup2 (&data, sizeof (TestParamImplementData));
g_test_add_data_func_full (test_path, test_data, test_param_implement_child, g_free);
g_free (test_data);
g_test_add_data_func_full (test_path, g_steal_pointer (&test_data), test_param_implement_child, g_free);
g_free (test_path);
}