tests: Fix a double-free when exercising argument parsing

g_option_context_add_group() takes ownership of the group that it's
given, so we can't also free it.

Fixes: fab0f8ed "test-context: Exercise some corner cases for merging filesystems"
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 80c1fc5f78)
This commit is contained in:
Simon McVittie
2024-02-15 00:00:40 +00:00
parent 1e4f3adaec
commit 8a6545e1c9

View File

@@ -158,7 +158,7 @@ context_parse_args (FlatpakContext *context,
oc = g_option_context_new ("");
group = flatpak_context_get_options (context);
g_option_context_add_group (oc, group);
g_option_context_add_group (oc, g_steal_pointer (&group));
g_option_context_parse_strv (oc, &argv, error);
}