gst-plugins-bad: linsyssdi: fix leaks

Vincent Penquerc'h vincent at kemper.freedesktop.org
Fri Jan 13 02:33:38 PST 2012


Module: gst-plugins-bad
Branch: master
Commit: 525a995569f318609f23e36a37115e6be8f848f9
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=525a995569f318609f23e36a37115e6be8f848f9

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Fri Jan 13 10:32:59 2012 +0000

linsyssdi: fix leaks

---

 sys/linsys/gstlinsyssdisink.c |    5 +++++
 sys/linsys/gstlinsyssdisrc.c  |    5 ++++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/sys/linsys/gstlinsyssdisink.c b/sys/linsys/gstlinsyssdisink.c
index e4260c0..28b64b2 100644
--- a/sys/linsys/gstlinsyssdisink.c
+++ b/sys/linsys/gstlinsyssdisink.c
@@ -196,9 +196,14 @@ gst_linsys_sdi_sink_get_property (GObject * object, guint property_id,
 void
 gst_linsys_sdi_sink_dispose (GObject * object)
 {
+  GstLinsysSdiSink *linsyssdisink;
+
   g_return_if_fail (GST_IS_LINSYS_SDI_SINK (object));
+  linsyssdisink = GST_LINSYS_SDI_SINK (object);
 
   /* clean up as possible.  may be called multiple times */
+  g_free (linsyssdisink->device);
+  linsyssdisink->device = NULL;
 
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }
diff --git a/sys/linsys/gstlinsyssdisrc.c b/sys/linsys/gstlinsyssdisrc.c
index 467c54c..a9732f5 100644
--- a/sys/linsys/gstlinsyssdisrc.c
+++ b/sys/linsys/gstlinsyssdisrc.c
@@ -212,9 +212,12 @@ gst_linsys_sdi_src_get_property (GObject * object, guint property_id,
 void
 gst_linsys_sdi_src_dispose (GObject * object)
 {
-  g_return_if_fail (GST_IS_LINSYS_SDI_SRC (object));
+  GstLinsysSdiSrc *linsyssdisrc = GST_LINSYS_SDI_SRC (object);
+  g_return_if_fail (linsyssdisrc != NULL);
 
   /* clean up as possible.  may be called multiple times */
+  g_free (linsyssdisrc->device);
+  linsyssdisrc->device = NULL;
 
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }



More information about the gstreamer-commits mailing list