fix a caps leak
authorThomas Vander Stichele <thomas@apestaart.org>
Sat, 9 Jul 2005 23:47:23 +0000 (23:47 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Sat, 9 Jul 2005 23:47:23 +0000 (23:47 +0000)
Original commit message from CVS:
fix a caps leak

ChangeLog
gst/gstpad.c

index b769a70..680faf2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-07-10  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+       * gst/gstpad.c: (gst_pad_link_check_compatible_unlocked):
+         fix a caps leak
+
+2005-07-10  Thomas Vander Stichele  <thomas at apestaart dot org>
+
        * gst/base/gstbasesrc.c: (gst_base_src_class_init),
        (gst_base_src_finalize):
          add finalize method and clean up properly
index d2c9f2b..13f480c 100644 (file)
@@ -1364,6 +1364,7 @@ gst_pad_link_check_compatible_unlocked (GstPad * src, GstPad * sink)
 {
   GstCaps *srccaps;
   GstCaps *sinkcaps;
+  gboolean ret;
 
   srccaps = gst_pad_get_caps_unlocked (src);
   sinkcaps = gst_pad_get_caps_unlocked (sink);
@@ -1380,8 +1381,10 @@ gst_pad_link_check_compatible_unlocked (GstPad * src, GstPad * sink)
     GST_CAT_DEBUG (GST_CAT_CAPS,
         "intersection caps %p %" GST_PTR_FORMAT, icaps, icaps);
 
-    if (!icaps || gst_caps_is_empty (icaps))
+    if (!icaps || gst_caps_is_empty (icaps)) {
+      gst_caps_unref (icaps);
       return FALSE;
+    }
   }
 
   return TRUE;