validate: pad-monitor: fix caps leak
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 27 Mar 2015 14:59:42 +0000 (15:59 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Tue, 31 Mar 2015 07:45:06 +0000 (09:45 +0200)
Don't create othercaps when early returning.

validate/gst/validate/gst-validate-pad-monitor.c

index 440a13b..ad6ce35 100644 (file)
@@ -666,7 +666,7 @@ static GstCaps *
 gst_validate_pad_monitor_transform_caps (GstValidatePadMonitor * monitor,
     GstCaps * caps)
 {
-  GstCaps *othercaps = gst_caps_new_empty ();
+  GstCaps *othercaps;
   GstCaps *new_caps;
   GstIterator *iter;
   gboolean done;
@@ -678,6 +678,8 @@ gst_validate_pad_monitor_transform_caps (GstValidatePadMonitor * monitor,
   if (caps == NULL)
     return NULL;
 
+  othercaps = gst_caps_new_empty ();
+
   iter =
       gst_pad_iterate_internal_links (GST_VALIDATE_PAD_MONITOR_GET_PAD
       (monitor));