diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c index 37f9b4fd31..63ac3afc08 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); @@ -710,6 +713,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);