[glib: 2/6] gbookmarkfile: Fix a minor leak on an error path
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/6] gbookmarkfile: Fix a minor leak on an error path
- Date: Tue, 5 Nov 2019 10:59:04 +0000 (UTC)
commit 4332e3b160a1fef92f86b38be3b7286712925d67
Author: Philip Withnall <withnall endlessm com>
Date: Tue Nov 5 10:08:45 2019 +0000
gbookmarkfile: Fix a minor leak on an error path
Signed-off-by: Philip Withnall <withnall endlessm com>
glib/gbookmarkfile.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c
index 25f1234d7..e22f794e8 100644
--- a/glib/gbookmarkfile.c
+++ b/glib/gbookmarkfile.c
@@ -775,13 +775,22 @@ parse_bookmark_element (GMarkupParseContext *context,
item = bookmark_item_new (uri);
if (added != NULL && !timestamp_from_iso8601 (added, &item->added, error))
- return;
+ {
+ bookmark_item_free (item);
+ return;
+ }
if (modified != NULL && !timestamp_from_iso8601 (modified, &item->modified, error))
- return;
+ {
+ bookmark_item_free (item);
+ return;
+ }
if (visited != NULL && !timestamp_from_iso8601 (visited, &item->visited, error))
- return;
+ {
+ bookmark_item_free (item);
+ return;
+ }
add_error = NULL;
g_bookmark_file_add_item (parse_data->bookmark_file,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]