fixed assignment and plugged memory leak
authorGuido Berhoerster <gber@opensuse.org>
Wed, 13 Jul 2011 10:49:09 +0000 (12:49 +0200)
committerAndrea Florio <andrea@opensuse.org>
Wed, 13 Jul 2011 14:03:05 +0000 (16:03 +0200)
src/utils.c

index 2bffa7c..2ae5b46 100644 (file)
@@ -164,7 +164,7 @@ static gboolean install_icon_theme_package(const char* package_path)
             if(dir)
             {
                 char* name;
-                while(name == (char*)g_dir_read_name(dir))
+                while((name = (char*)g_dir_read_name(dir)) != NULL)
                 {
                     char* index_theme = g_build_filename(tmp_dir, name, "index.theme", NULL);
                     gboolean is_theme = g_file_test(index_theme, G_FILE_TEST_EXISTS);
@@ -192,6 +192,7 @@ static gboolean install_icon_theme_package(const char* package_path)
                         g_free(theme_target);
                         g_free(theme_tmp);
                     }
+                    g_free(name);
                 }
                 g_dir_close(dir);