updateiconcache: Fix path leak

This commit is contained in:
correctmost 2025-01-12 00:08:42 -05:00
parent 360fb0fe78
commit 0b874d13a7

View File

@ -644,14 +644,17 @@ scan_directory (const gchar *base_path,
directories = scan_directory (base_path, subsubdir, files, directories = scan_directory (base_path, subsubdir, files,
directories, depth + 1); directories, depth + 1);
g_free (subsubdir); g_free (subsubdir);
g_free (path);
continue; continue;
} }
/* ignore images in the toplevel directory */ /* ignore images in the toplevel directory */
if (subdir == NULL) if (subdir == NULL)
continue; {
g_free (path);
continue;
}
retval = g_file_test (path, G_FILE_TEST_IS_REGULAR); retval = g_file_test (path, G_FILE_TEST_IS_REGULAR);
if (retval) if (retval)
{ {
@ -665,7 +668,10 @@ scan_directory (const gchar *base_path,
flags |= HAS_ICON_FILE; flags |= HAS_ICON_FILE;
if (flags == 0) if (flags == 0)
continue; {
g_free (path);
continue;
}
basename = g_strdup (name); basename = g_strdup (name);
dot = strrchr (basename, '.'); dot = strrchr (basename, '.');