From e921b5b0f3187ff3b210dd54473ff887eca020ab Mon Sep 17 00:00:00 2001 From: Miguel Angel Cabrera Moya Date: Sun, 28 Oct 2012 19:59:41 +0100 Subject: [PATCH] exiftag: fix use after free and memory leak https://bugzilla.gnome.org/show_bug.cgi?id=687055 --- gst-libs/gst/tag/gstexiftag.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/tag/gstexiftag.c b/gst-libs/gst/tag/gstexiftag.c index 9830e21..38d0432 100644 --- a/gst-libs/gst/tag/gstexiftag.c +++ b/gst-libs/gst/tag/gstexiftag.c @@ -1252,15 +1252,15 @@ parse_exif_ascii_tag (GstExifReader * reader, const GstExifTagMatch * tag, GST_DEBUG ("Exif string isn't utf8, trying to convert from latin1: %s", str); utfstr = g_convert (str, count, "utf8", "latin1", NULL, NULL, &error); - g_free (str); if (error) { GST_WARNING ("Skipping tag %d:%s. Failed to convert ascii string " "to utf8 : %s - %s", tag->exif_tag, tag->gst_tag, str, error->message); g_error_free (error); - g_free (utfstr); + g_free (str); return; } + g_free (str); } tagtype = gst_tag_get_type (tag->gst_tag); @@ -1276,7 +1276,7 @@ parse_exif_ascii_tag (GstExifReader * reader, const GstExifTagMatch * tag, tag->gst_tag, d, NULL); gst_date_time_unref (d); } else { - GST_WARNING ("Failed to parse %s into a datetime tag", str); + GST_WARNING ("Failed to parse %s into a datetime tag", utfstr); } } else if (tagtype == G_TYPE_STRING) { gst_tag_list_add (reader->taglist, GST_TAG_MERGE_REPLACE, tag->gst_tag, -- 2.7.4