tests/examples/metadata/read-metadata.c: Don't leak old taglist.

Original commit message from CVS:
* tests/examples/metadata/read-metadata.c:
Don't leak old taglist.
This commit is contained in:
Stefan Kost 2008-08-05 15:42:00 +00:00
parent 70a4cad10c
commit 71ba3c6fce
2 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2008-08-05 Stefan Kost <ensonic@users.sf.net>
* tests/examples/metadata/read-metadata.c:
Don't leak old taglist.
2008-08-05 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: Olivier Crete <tester at tester dot ca>

View file

@ -63,12 +63,14 @@ message_loop (GstElement * element, GstTagList ** tags)
return TRUE;
case GST_MESSAGE_TAG:
{
GstTagList *new_tags;
GstTagList *new_tags, *old_tags;
gst_message_parse_tag (message, &new_tags);
if (*tags)
*tags = gst_tag_list_merge (*tags, new_tags, GST_TAG_MERGE_KEEP);
else
if (*tags) {
old_tags = *tags;
*tags = gst_tag_list_merge (old_tags, new_tags, GST_TAG_MERGE_KEEP);
gst_tag_list_free (old_tags);
} else
*tags = new_tags;
break;
}