opusdec: fix caps leaks
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 28 Apr 2016 06:59:25 +0000 (09:59 +0300)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 28 Apr 2016 08:18:53 +0000 (09:18 +0100)
The caps returned by gst_pad_get_allowed_caps() was leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=765706

ext/opus/gstopusdec.c

index b25b68f..052b4a4 100644 (file)
@@ -267,6 +267,7 @@ gst_opus_dec_negotiate (GstOpusDec * dec, const GstAudioChannelPosition * pos)
     if (gst_caps_is_empty (inter)) {
       GST_DEBUG_OBJECT (dec, "Empty intersection, failed to negotiate");
       gst_caps_unref (inter);
+      gst_caps_unref (caps);
       return FALSE;
     }
 
@@ -283,6 +284,7 @@ gst_opus_dec_negotiate (GstOpusDec * dec, const GstAudioChannelPosition * pos)
 
     dec->sample_rate = rate;
     dec->n_channels = channels;
+    gst_caps_unref (caps);
   }
 
   if (dec->n_channels == 0) {