codecanalyzer: 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 being reported.

https://bugzilla.gnome.org/show_bug.cgi?id=753862
This commit is contained in:
Vineeth T M 2015-08-20 16:54:14 +09:00 committed by Tim-Philipp Müller
parent 680ca5e10f
commit 581b0cfced

View file

@ -1015,6 +1015,8 @@ main (int argc, char *argv[])
g_printerr ("Failed to initialize: %s\n", err->message);
else
g_printerr ("Failed to initialize, Unknown error\n");
g_clear_error (&err);
g_option_context_free (ctx);
exit (1);
}
g_option_context_free (ctx);