[syslinux] [PATCH 2/4] elflink: Fix the wrong malloc size in enter_cmdline
Liu Aleaxander
aleaxander at gmail.com
Sat Oct 2 09:36:10 PDT 2010
Signed-off-by: Liu Aleaxander <Aleaxander at gmail.com>
---
core/elflink/load_env32.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/core/elflink/load_env32.c b/core/elflink/load_env32.c
index 3f4b6ff..99bf7a3 100644
--- a/core/elflink/load_env32.c
+++ b/core/elflink/load_env32.c
@@ -76,9 +76,8 @@ void enter_cmdline(void)
/* feng: give up the aux check here */
//aux = list_entry(cli_history_head.next, typeof(*aux), list);
//if (strcmp(aux->command, cmdline)) {
- comm = (struct cli_command *)malloc(sizeof(struct cli_command *));
- comm->command =
- (char *)malloc(sizeof(char) * (strlen(cmdline) + 1));
+ comm = malloc(sizeof(struct cli_command));
+ comm->command = malloc(sizeof(char) * (strlen(cmdline) + 1));
strcpy(comm->command, cmdline);
list_add(&(comm->list), &cli_history_head);
process_command(cmdline);
--
1.7.0.1
More information about the Syslinux
mailing list