summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-08-27 12:27:40 +0000
committerOlivier Blin <oblin@mandriva.com>2007-08-27 12:27:40 +0000
commit88e0184829f1cdb2dd5c8f3b2980c95de1ecc6b4 (patch)
treee90e104f6b8bc03b06e4bf15c67d3e7aa73a83b4 /mdk-stage1
parent5302132f01fabaa70c2e4489a318e8acf8267c8c (diff)
downloaddrakx-backup-do-not-use-88e0184829f1cdb2dd5c8f3b2980c95de1ecc6b4.tar
drakx-backup-do-not-use-88e0184829f1cdb2dd5c8f3b2980c95de1ecc6b4.tar.gz
drakx-backup-do-not-use-88e0184829f1cdb2dd5c8f3b2980c95de1ecc6b4.tar.bz2
drakx-backup-do-not-use-88e0184829f1cdb2dd5c8f3b2980c95de1ecc6b4.tar.xz
drakx-backup-do-not-use-88e0184829f1cdb2dd5c8f3b2980c95de1ecc6b4.zip
use alloca
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/modules.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c
index 5130401ee..927f33fcb 100644
--- a/mdk-stage1/modules.c
+++ b/mdk-stage1/modules.c
@@ -354,8 +354,8 @@ enum return_type ask_insmod(enum driver_type type)
enum return_type results;
char * choice;
char ** dlist = list_directory("/modules");
- char ** modules = malloc(sizeof(char *) * (string_array_length(dlist) + 1));
- char ** descrs = malloc(sizeof(char *) * (string_array_length(dlist) + 1));
+ char ** modules = alloca(sizeof(char *) * (string_array_length(dlist) + 1));
+ char ** descrs = alloca(sizeof(char *) * (string_array_length(dlist) + 1));
char ** p_dlist = dlist;
char ** p_modules = modules;
char ** p_descrs = descrs;
@@ -369,6 +369,7 @@ enum return_type ask_insmod(enum driver_type type)
continue;
}
*p_modules = *p_dlist;
+ *p_descrs = NULL;
(*p_modules)[strlen(*p_modules)-strlen(kernel_module_extension())] = '\0'; /* remove trailing .ko.gz */
for (i = 0 ; i < modules_descriptions_num ; i++) {
if (!strcmp(*p_modules, modules_descriptions[i].module))