discoverer: don't leak parent tags
authorStefan Kost <ensonic@users.sf.net>
Wed, 16 Feb 2011 09:57:31 +0000 (11:57 +0200)
committerStefan Kost <ensonic@users.sf.net>
Wed, 16 Feb 2011 10:01:03 +0000 (12:01 +0200)
gst-libs/gst/pbutils/gstdiscoverer.c

index 2a019c0..dede0b3 100644 (file)
@@ -846,15 +846,20 @@ parse_stream_topology (GstDiscoverer * dc, const GstStructure * topology,
     res = (GstDiscovererStreamInfo *) cont;
 
     if (gst_structure_id_has_field (topology, _TAGS_QUARK)) {
+      GstTagList *tmp;
+
       gst_structure_id_get (topology, _TAGS_QUARK,
           GST_TYPE_STRUCTURE, &tags, NULL);
 
       GST_DEBUG ("Merge tags %" GST_PTR_FORMAT, tags);
 
-      cont->parent.tags =
+      tmp =
           gst_tag_list_merge (cont->parent.tags, (GstTagList *) tags,
           GST_TAG_MERGE_APPEND);
       gst_tag_list_free (tags);
+      if (cont->parent.tags)
+        gst_tag_list_free (cont->parent.tags);
+      cont->parent.tags = tmp;
       GST_DEBUG ("Container info tags %" GST_PTR_FORMAT, tmp);
     }