From 0b874d13a78f8b47b4c9fa179b84e0f8b096570c Mon Sep 17 00:00:00 2001 From: correctmost <136447-correctmost@users.noreply.gitlab.gnome.org> Date: Sun, 12 Jan 2025 00:08:42 -0500 Subject: [PATCH] updateiconcache: Fix path leak --- gtk/updateiconcache.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c index 61c42c7a5a..37f9b4fd31 100644 --- a/gtk/updateiconcache.c +++ b/gtk/updateiconcache.c @@ -644,14 +644,17 @@ scan_directory (const gchar *base_path, directories = scan_directory (base_path, subsubdir, files, directories, depth + 1); g_free (subsubdir); + g_free (path); continue; } /* ignore images in the toplevel directory */ if (subdir == NULL) - continue; - + { + g_free (path); + continue; + } retval = g_file_test (path, G_FILE_TEST_IS_REGULAR); if (retval) { @@ -665,7 +668,10 @@ scan_directory (const gchar *base_path, flags |= HAS_ICON_FILE; if (flags == 0) - continue; + { + g_free (path); + continue; + } basename = g_strdup (name); dot = strrchr (basename, '.');