diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2006-11-26 17:55:36 +0000 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2006-11-26 17:55:36 +0000 |
commit | bdebb25ba5dcd9727cfbef5dd8b7a77ba9030a9c (patch) | |
tree | 57a016dd47097250304985b2347f39b22818b2e8 /hardinfo2/util.c | |
parent | 83b3021873da4bb34db92c95398164196be7b18a (diff) |
Forgot to close the directory :P
Diffstat (limited to 'hardinfo2/util.c')
-rw-r--r-- | hardinfo2/util.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/hardinfo2/util.c b/hardinfo2/util.c index bf5926f0..da3a338b 100644 --- a/hardinfo2/util.c +++ b/hardinfo2/util.c @@ -475,16 +475,15 @@ static GSList *modules_load(gchar **module_list) dir = g_dir_open(filename, 0, NULL); g_free(filename); - if (!dir) { - return NULL; - } - - while ((filename = (gchar*)g_dir_read_name(dir))) { - if (module_in_module_list(filename, module_list)) { - if ((module = module_load(filename))) { - modules = g_slist_append(modules, module); + if (dir) { + while ((filename = (gchar*)g_dir_read_name(dir))) { + if (module_in_module_list(filename, module_list) && + ((module = module_load(filename)))) { + modules = g_slist_append(modules, module); } } + + g_dir_close(dir); } if (g_slist_length(modules) == 0) { |