mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-05 17:09:48 +00:00
gst-omx: Fix memory leaks when context parse fails
When g_option_context_parse fails, context and error variables are not getting free'd which results in memory leaks. Free'ing the same. And replacing g_error_free with g_clear_error, which checks if the error being passed is not NULL and sets the variable to NULL on free'ing. https://bugzilla.gnome.org/show_bug.cgi?id=753865
This commit is contained in:
parent
e0327521f6
commit
fb95ce9bfc
1 changed files with 2 additions and 0 deletions
|
@ -1495,6 +1495,8 @@ main (int argc, char **argv)
|
||||||
g_option_context_add_group (ctx, gst_init_get_option_group ());
|
g_option_context_add_group (ctx, gst_init_get_option_group ());
|
||||||
if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
|
if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
|
||||||
g_print ("Error initializing: %s\n", GST_STR_NULL (err->message));
|
g_print ("Error initializing: %s\n", GST_STR_NULL (err->message));
|
||||||
|
g_option_context_free (ctx);
|
||||||
|
g_clear_error (&err);
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
g_option_context_free (ctx);
|
g_option_context_free (ctx);
|
||||||
|
|
Loading…
Reference in a new issue