updateiconcache: Fix path leak in scan_directory

This commit is contained in:
correctmost
2024-11-12 03:15:11 -05:00
parent 4f5e492d0f
commit cd7fa32866

View File

@ -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);