mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 18:36:17 +01:00
gbookmarkfile: Fix some minor leaks when metadata elements are repeated
oss-fuzz#9674 Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
433770b681
commit
6c041ff283
@ -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 \
|
||||
|
1
glib/tests/bookmarks/fail-39.xbel
Normal file
1
glib/tests/bookmarks/fail-39.xbel
Normal file
@ -0,0 +1 @@
|
||||
<xbel version="1.0"><bookmark href=""><info><metadata owner="http://freedesktop.org"><mime-type/><mime-type/
|
Loading…
Reference in New Issue
Block a user