close #333784 unref the result of gst_pad_get_parent() by: Christophe Fergeau.
[platform/upstream/gstreamer.git] / gst / rtp / gstrtpL16pay.c
index 466e4b0..f68425c 100644 (file)
@@ -171,13 +171,17 @@ gst_rtpL16pay_sinkconnect (GstPad * pad, const GstCaps * caps)
   ret = gst_structure_get_int (structure, "rate", &rtpL16enc->frequency);
   ret &= gst_structure_get_int (structure, "channels", &rtpL16enc->channels);
 
-  if (!ret)
+  if (!ret) {
+    gst_object_unref (rtpL16enc);
     return GST_PAD_LINK_REFUSED;
+  }
 
   /* Pre-calculate what we can */
   rtpL16enc->time_interval =
       GST_SECOND / (2 * rtpL16enc->channels * rtpL16enc->frequency);
 
+  gst_object_unref (rtpL16enc);
+
   return GST_PAD_LINK_OK;
 }