glib2/backport-gbookmarkfile-Fix-a-minor-leak-on-an-error-path.patch
shirely16 a3d31ddf3c synchronous community patch
(cherry picked from commit 5fb95aa15490a21b390e53a88c1b8b052971e504)
2021-05-21 15:56:45 +08:00

49 lines
1.3 KiB
Diff

From 4332e3b160a1fef92f86b38be3b7286712925d67 Mon Sep 17 00:00:00 2001
From: Philip Withnall <withnall@endlessm.com>
Date: Tue, 5 Nov 2019 10:08:45 +0000
Subject: [PATCH 0115/1095] gbookmarkfile: Fix a minor leak on an error path
Signed-off-by: Philip Withnall <withnall@endlessm.com>
reason:Fix a minor leak on an error path
Conflict:NA
Reference:https://github.com/GNOME/glib/commit/4332e3b160a1fef92f86b38be3b7286712925d67
---
glib/gbookmarkfile.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c
index 25f1234..e22f794 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,
--
1.8.3.1