From bdebb25ba5dcd9727cfbef5dd8b7a77ba9030a9c Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Sun, 26 Nov 2006 17:55:36 +0000 Subject: Forgot to close the directory :P --- hardinfo2/util.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'hardinfo2') 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) { -- cgit v1.2.3