rtp: Fix some memory leaks in usage of gst_pad_get_current_caps()
authorGarima Gaur <garima.g@samsung.com>
Thu, 1 Dec 2016 09:36:06 +0000 (15:06 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 1 Dec 2016 11:04:03 +0000 (13:04 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=775071

gst/rtp/gstrtph264depay.c
gst/rtp/gstrtpsbcdepay.c

index 056724c..ff5415c 100644 (file)
@@ -432,6 +432,7 @@ gst_rtp_h264_set_src_caps (GstRtpH264Depay * rtph264depay)
 
       gst_caps_unref (tmp_caps);
     }
+    gst_caps_unref (old_caps);
   } else {
     res =
         gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph264depay),
index 7f8ba39..353b403 100644 (file)
@@ -181,6 +181,8 @@ gst_rtp_sbc_depay_setcaps (GstRTPBaseDepayload * base, GstCaps * caps)
   }
 
   gst_caps_unref (outcaps);
+  if (oldcaps)
+     gst_caps_unref (oldcaps);
 
   return TRUE;