mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
discoverer: free context and error during failures
When g_option_context_parse or gst_discoverer_new fails, then there will be memory leaks for ctx and err variables. Free'ing the same. https://bugzilla.gnome.org/show_bug.cgi?id=753701
This commit is contained in:
parent
135cad5b6e
commit
6ee8b22c40
1 changed files with 3 additions and 0 deletions
|
@ -555,6 +555,8 @@ main (int argc, char **argv)
|
|||
|
||||
if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
|
||||
g_print ("Error initializing: %s\n", err->message);
|
||||
g_option_context_free (ctx);
|
||||
g_clear_error (&err);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
@ -568,6 +570,7 @@ main (int argc, char **argv)
|
|||
dc = gst_discoverer_new (timeout * GST_SECOND, &err);
|
||||
if (G_UNLIKELY (dc == NULL)) {
|
||||
g_print ("Error initializing: %s\n", err->message);
|
||||
g_clear_error (&err);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue