summaryrefslogtreecommitdiff
path: root/tools/gst-discoverer.c
diff options
context:
space:
mode:
authorVineeth TM <vineeth.tm@samsung.com>2015-08-17 11:18:25 +0900
committerSebastian Dröge <sebastian@centricular.com>2015-08-17 14:11:17 +0200
commit6ee8b22c403bb15407ca012e54cf463c1b24ed13 (patch)
treeb20df379fd65ddcf4673e86ac2bde4981acad06b /tools/gst-discoverer.c
parent135cad5b6eecefec7aa6e780dbdf88d36835dd88 (diff)
downloadgstreamer-plugins-base-6ee8b22c403bb15407ca012e54cf463c1b24ed13.tar.gz
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
Diffstat (limited to 'tools/gst-discoverer.c')
-rw-r--r--tools/gst-discoverer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/gst-discoverer.c b/tools/gst-discoverer.c
index 045332ddf..2c088e56d 100644
--- a/tools/gst-discoverer.c
+++ b/tools/gst-discoverer.c
@@ -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);
}