Commit 6c041ff2 authored by Philip Withnall's avatar Philip Withnall

gbookmarkfile: Fix some minor leaks when metadata elements are repeated

oss-fuzz#9674
Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
parent 433770b6
......@@ -915,7 +915,8 @@ parse_mime_type_element (GMarkupParseContext *context,
if (!item->metadata)
item->metadata = bookmark_metadata_new ();
g_free (item->metadata->mime_type);
item->metadata->mime_type = g_strdup (type);
}
......@@ -964,7 +965,9 @@ parse_icon_element (GMarkupParseContext *context,
if (!item->metadata)
item->metadata = bookmark_metadata_new ();
g_free (item->metadata->icon_href);
g_free (item->metadata->icon_mime);
item->metadata->icon_href = g_strdup (href);
item->metadata->icon_mime = g_strdup (type);
}
......
......@@ -164,6 +164,7 @@ dist_test_data += \
bookmarks/fail-36.xbel \
bookmarks/fail-37.xbel \
bookmarks/fail-38.xbel \
bookmarks/fail-39.xbel \
bookmarks/valid-01.xbel \
bookmarks/valid-02.xbel \
bookmarks/valid-03.xbel \
......
<xbel version="1.0"><bookmark href=""><info><metadata owner="http://freedesktop.org"><mime-type/><mime-type/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment