summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Keller <skeller@gnome.org>2022-08-30 21:39:36 +0200
committerMarco Trevisan (TreviƱo) <mail@3v1n0.net>2022-09-02 19:48:36 +0200
commit27203e48c91ab8b55033dcf1773cb60c0aaed3fa (patch)
tree83fbbe7918d7ffcb746069595e71bce7d91812fe
parent511627b7356af527c85c049e2020a36694d7de54 (diff)
downloadglib-27203e48c91ab8b55033dcf1773cb60c0aaed3fa.tar.gz
documentportal: Fix small leak in add_documents with empty URI list
When called with an empty URI list (or only inaccessible files), g_document_portal_add_documents would not call g_variant_builder_end, leaking the memory allocated by the variant builder. Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/2733
-rw-r--r--gio/gdocumentportal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gio/gdocumentportal.c b/gio/gdocumentportal.c
index c08c36c58..382e2aab6 100644
--- a/gio/gdocumentportal.c
+++ b/gio/gdocumentportal.c
@@ -203,6 +203,7 @@ g_document_portal_add_documents (GList *uris,
else
{
ruris = g_list_copy_deep (uris, (GCopyFunc)g_strdup, NULL);
+ g_variant_builder_clear (&builder);
}
out: