summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Kumar <kr.ashish@samsung.com>2017-10-31 15:04:47 +0530
committerSebastian Dröge <sebastian@centricular.com>2018-01-17 15:58:09 +0200
commit76e35a9031f0731b5fc452d801381ad55c4ba017 (patch)
tree149a8490e69e79949057429c48a36d99941990b6
parent7979a3edbd1e60eefec8ca2d10b2c0e7b44eef4d (diff)
downloadgstreamer-plugins-base-76e35a9031f0731b5fc452d801381ad55c4ba017.tar.gz
playback-utils: Fix caps leak on failure
https://bugzilla.gnome.org/show_bug.cgi?id=789358
-rw-r--r--gst/playback/gstplaybackutils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gst/playback/gstplaybackutils.c b/gst/playback/gstplaybackutils.c
index ef98528e0..00becf0ed 100644
--- a/gst/playback/gstplaybackutils.c
+++ b/gst/playback/gstplaybackutils.c
@@ -82,6 +82,10 @@ gst_playback_utils_get_n_common_capsfeatures (GstElementFactory * fact1,
fact2_tmpl_caps = get_template_caps (fact2, GST_PAD_SINK);
if (!fact1_tmpl_caps || !fact2_tmpl_caps) {
GST_ERROR ("Failed to get template caps from decoder or sink");
+ if (fact1_tmpl_caps)
+ gst_caps_unref (fact1_tmpl_caps);
+ else if (fact2_tmpl_caps)
+ gst_caps_unref (fact2_tmpl_caps);
return 0;
}