v4l2src: fix caps leak
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 13 Jan 2012 17:25:59 +0000 (17:25 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 13 Jan 2012 17:25:59 +0000 (17:25 +0000)
sys/v4l2/gstv4l2src.c

index e2175a4..f8ae09c 100644 (file)
@@ -522,11 +522,12 @@ gst_v4l2src_negotiate (GstBaseSrc * basesrc)
       }
     }
     gst_caps_unref (thiscaps);
-    gst_caps_unref (peercaps);
   } else {
     /* no peer or peer have ANY caps, work with our own caps then */
     caps = thiscaps;
   }
+  if (peercaps)
+    gst_caps_unref (peercaps);
   if (caps) {
     caps = gst_caps_make_writable (caps);
     gst_caps_truncate (caps);