From cd7fa32866869beb211f9e02cd822a5c7edac1bf Mon Sep 17 00:00:00 2001 From: correctmost <136447-correctmost@users.noreply.gitlab.gnome.org> Date: Tue, 12 Nov 2024 03:15:11 -0500 Subject: [PATCH] updateiconcache: Fix path leak in scan_directory --- gtk/updateiconcache.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c index 61c42c7a5a..fa3062a09c 100644 --- a/gtk/updateiconcache.c +++ b/gtk/updateiconcache.c @@ -612,7 +612,10 @@ scan_directory (const gchar *base_path, dir = g_dir_open (dir_path, 0, NULL); if (!dir) - return directories; + { + g_free (dir_path); + return directories; + } dir_hash = g_hash_table_new (g_str_hash, g_str_equal); @@ -704,6 +707,7 @@ scan_directory (const gchar *base_path, g_list_free_full (list, g_free); g_dir_close (dir); + g_free (dir_path); /* Move dir into the big file hash */ g_hash_table_foreach_remove (dir_hash, foreach_remove_func, files);