[0.10] gst-plugins-base: discoverer: fix structure leak

Tim Müller tpm at kemper.freedesktop.org
Thu Jan 12 09:48:36 PST 2012


Module: gst-plugins-base
Branch: 0.10
Commit: b8ba399a2ee04048fa54dd557190a1ba60111267
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=b8ba399a2ee04048fa54dd557190a1ba60111267

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Thu Jan 12 14:26:05 2012 +0000

discoverer: fix structure leak

I hit the 'misc' one, but let's also make sure the topology
one get freed as well, though I do not know if this can happen
twice.

---

 gst-libs/gst/pbutils/gstdiscoverer.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c
index ce1cd0d..8d2d03b 100644
--- a/gst-libs/gst/pbutils/gstdiscoverer.c
+++ b/gst-libs/gst/pbutils/gstdiscoverer.c
@@ -1160,8 +1160,12 @@ handle_message (GstDiscoverer * dc, GstMessage * msg)
         GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
             "Setting result to MISSING_PLUGINS");
         dc->priv->current_info->result = GST_DISCOVERER_MISSING_PLUGINS;
+        if (dc->priv->current_info->misc)
+          gst_structure_free (dc->priv->current_info->misc);
         dc->priv->current_info->misc = gst_structure_copy (msg->structure);
       } else if (sttype == _STREAM_TOPOLOGY_QUARK) {
+        if (dc->priv->current_topology)
+          gst_structure_free (dc->priv->current_topology);
         dc->priv->current_topology = gst_structure_copy (msg->structure);
       }
     }



More information about the gstreamer-commits mailing list