From cdc40b11f4d7a3050bda164b2d92afc23616b7f9 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Thu, 5 Jul 2007 19:21:21 +0000 Subject: Cleanups. Plug most of the memleaks. --- hardinfo2/arch/linux/common/modules.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'hardinfo2/arch/linux/common/modules.h') diff --git a/hardinfo2/arch/linux/common/modules.h b/hardinfo2/arch/linux/common/modules.h index fd5f0fa1..6fbe13bd 100644 --- a/hardinfo2/arch/linux/common/modules.h +++ b/hardinfo2/arch/linux/common/modules.h @@ -39,8 +39,7 @@ scan_modules_do(void) g_free(module_list); } - module_list = g_strdup(""); - + module_list = NULL; g_hash_table_foreach_remove(moreinfo, remove_module_devices, NULL); lsmod = popen("/sbin/lsmod", "r"); @@ -99,7 +98,7 @@ scan_modules_do(void) } /* append this module to the list of modules */ - module_list = g_strdup_printf("%s$%s$%s=%s\n", + module_list = h_strdup_cprintf("$%s$%s=%s\n", module_list, hashkey, modname, @@ -130,7 +129,7 @@ scan_modules_do(void) if (deps && strlen(deps)) { gchar **tmp = g_strsplit(deps, ",", 0); - strmodule = g_strconcat(strmodule, + strmodule = h_strconcat(strmodule, "\n[Dependencies]\n", g_strjoinv("=\n", tmp), "=\n", NULL); -- cgit v1.2.3