gst-validate-1.0: Don't leak arguments and context

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
This commit is contained in:
Edward Hervey 2022-11-04 11:23:12 +01:00 committed by GStreamer Marge Bot
parent 3beec9bad3
commit 73762156f3

View file

@ -448,16 +448,19 @@ main (int argc, gchar ** argv)
gst_validate_init ();
if (list_scenarios || output_file) {
int ret = 0;
g_option_context_free (ctx);
if (gst_validate_list_scenarios (argv + 1, argc - 1, output_file))
return 1;
return 0;
ret = 1;
g_free (output_file);
return ret;
}
if (inspect_action_type) {
_register_playbin_actions ();
if (!gst_validate_print_action_types ((const gchar **) argv + 1, argc - 1)) {
g_option_context_free (ctx);
GST_ERROR ("Could not print all wanted types");
return -1;
}
@ -467,6 +470,7 @@ main (int argc, gchar ** argv)
if (print_issue_types) {
gst_validate_print_issues ();
g_option_context_free (ctx);
return 0;
}