diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-07-05 19:21:21 +0000 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-07-05 19:21:21 +0000 |
commit | cdc40b11f4d7a3050bda164b2d92afc23616b7f9 (patch) | |
tree | 03cd201e20016a39a60e875e591b1d969d68f425 /hardinfo2/arch/linux/common/modules.h | |
parent | ed4d0b93832732a199f4fb07c70350401f2eaceb (diff) |
Cleanups. Plug most of the memleaks.
Diffstat (limited to 'hardinfo2/arch/linux/common/modules.h')
-rw-r--r-- | hardinfo2/arch/linux/common/modules.h | 7 |
1 files changed, 3 insertions, 4 deletions
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); |