gst/gstutils.c: Fix a caps memory leak introduced by the last change.
authorSebastian Dröge <slomo@circular-chaos.org>
Tue, 9 Dec 2008 16:23:58 +0000 (16:23 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Tue, 9 Dec 2008 16:23:58 +0000 (16:23 +0000)
Original commit message from CVS:
* gst/gstutils.c: (gst_element_get_compatible_pad):
Fix a caps memory leak introduced by the last change.

ChangeLog
gst/gstutils.c

index 892cb50..e26b044 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 2008-12-09  Sebastian Dröge  <sebastian.droege@collabora.co.uk>
 
        * gst/gstutils.c: (gst_element_get_compatible_pad):
+       Fix a caps memory leak introduced by the last change.
+
+2008-12-09  Sebastian Dröge  <sebastian.droege@collabora.co.uk>
+
+       * gst/gstutils.c: (gst_element_get_compatible_pad):
        Check if the caps of the pads are compatible before returning
        a pad and claiming it is compatible. This, among other things,
        fixes a bug with gst-launch where an incompatible pad is chosen
index 16e5b0a..e778fb8 100644 (file)
@@ -989,6 +989,8 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
           intersection = temp2;
 
           if (!gst_caps_is_empty (intersection)) {
+            gst_caps_unref (intersection);
+
             GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,
                 "found existing unlinked compatible pad %s:%s",
                 GST_DEBUG_PAD_NAME (current));
@@ -996,6 +998,7 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
 
             return current;
           }
+          gst_caps_unref (intersection);
         }
         GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "unreffing pads");