• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 27203e48c91ab8b55033dcf1773cb60c0aaed3fa Mon Sep 17 00:00:00 2001
2From: Sebastian Keller <skeller@gnome.org>
3Date: Tue, 30 Aug 2022 21:39:36 +0200
4Subject: [PATCH] documentportal: Fix small leak in add_documents with empty
5 URI list
6
7When called with an empty URI list (or only inaccessible files),
8g_document_portal_add_documents would not call g_variant_builder_end,
9leaking the memory allocated by the variant builder.
10
11Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/2733
12
13Conflict:NA
14Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/27203e48c91ab8b55033dcf1773cb60c0aaed3fa
15
16---
17 gio/gdocumentportal.c | 1 +
18 1 file changed, 1 insertion(+)
19
20diff --git a/gio/gdocumentportal.c b/gio/gdocumentportal.c
21index c08c36c581..382e2aab6e 100644
22--- a/gio/gdocumentportal.c
23+++ b/gio/gdocumentportal.c
24@@ -203,6 +203,7 @@ g_document_portal_add_documents (GList       *uris,
25   else
26     {
27       ruris = g_list_copy_deep (uris, (GCopyFunc)g_strdup, NULL);
28+      g_variant_builder_clear (&builder);
29     }
30
31 out:
32--
33GitLab
34
35