summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-27 16:48:30 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-03-27 19:11:56 -0400
commit97a9e23b85d2a820d17af06dce2cc49c97b3779e (patch)
treedb03126e9a17fe8535a3511c0e7221f08386d8bc
parente7f9d56da5965fd64cf468e3f4ad9494f409c57c (diff)
downloadgtk+-97a9e23b85d2a820d17af06dce2cc49c97b3779e.tar.gz
bookmarklist: Avoid an invalid read
This shows up when running the objects-finalize test under valgrind.
-rw-r--r--gtk/gtkbookmarklist.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/gtkbookmarklist.c b/gtk/gtkbookmarklist.c
index 6afe1b46f4..6df9d5fa86 100644
--- a/gtk/gtkbookmarklist.c
+++ b/gtk/gtkbookmarklist.c
@@ -287,8 +287,15 @@ got_file_info (GObject *source,
GtkBookmarkList *self = user_data;
GFile *file = G_FILE (source);
GFileInfo *info;
+ GError *error = NULL;
+
+ info = g_file_query_info_finish (file, res, &error);
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ {
+ g_error_free (error);
+ return;
+ }
- info = g_file_query_info_finish (file, res, NULL);
if (info)
{
char *uri;