gst: Fix caps leak
authorGarima Gaur <garima.g@samsung.com>
Wed, 30 Nov 2016 05:10:42 +0000 (10:40 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 30 Nov 2016 07:59:08 +0000 (09:59 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=775072

gst/mpegpsmux/mpegpsmux.c
tests/examples/directfb/gstdfb.c

index fdd1c14..cdd3681 100644 (file)
@@ -341,6 +341,7 @@ mpegpsmux_create_stream (MpegPsMux * mux, MpegPsPadData * ps_data, GstPad * pad)
   }
 
 beach:
+  gst_caps_unref (caps);
   return ret;
 }
 
index 32ddd15..5fcc026 100644 (file)
@@ -91,11 +91,14 @@ size_changed (GObject * obj, GParamSpec * pspec, IDirectFBWindow * window)
     gint width, height;
 
     if (!(gst_structure_get_int (s, "width", &width) &&
-            gst_structure_get_int (s, "height", &height)))
+            gst_structure_get_int (s, "height", &height))) {
+      gst_caps_unref (caps);
       return;
+    }
 
     window->Resize (window, width, height);
   }
+  gst_caps_unref (caps);
 }
 
 static void