updateiconcache: Fix path leak in scan_directory
This commit is contained in:
@ -612,7 +612,10 @@ scan_directory (const gchar *base_path,
|
|||||||
dir = g_dir_open (dir_path, 0, NULL);
|
dir = g_dir_open (dir_path, 0, NULL);
|
||||||
|
|
||||||
if (!dir)
|
if (!dir)
|
||||||
return directories;
|
{
|
||||||
|
g_free (dir_path);
|
||||||
|
return directories;
|
||||||
|
}
|
||||||
|
|
||||||
dir_hash = g_hash_table_new (g_str_hash, g_str_equal);
|
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_list_free_full (list, g_free);
|
||||||
g_dir_close (dir);
|
g_dir_close (dir);
|
||||||
|
g_free (dir_path);
|
||||||
|
|
||||||
/* Move dir into the big file hash */
|
/* Move dir into the big file hash */
|
||||||
g_hash_table_foreach_remove (dir_hash, foreach_remove_func, files);
|
g_hash_table_foreach_remove (dir_hash, foreach_remove_func, files);
|
||||||
|
|||||||
Reference in New Issue
Block a user