aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux/cli.c
diff options
context:
space:
mode:
authorLiu Aleaxander <Aleaxander@gmail.com>2011-03-15 20:24:57 +0000
committerMatt Fleming <matt.fleming@linux.intel.com>2011-03-15 21:14:27 +0000
commit97e12159159b793292d1f5708aab6c32f06edce4 (patch)
tree27d217db720bc7867ac2798c3b16130d001c41d2 /com32/elflink/ldlinux/cli.c
parent9ded45991b4fc83b40af963feb773ddca2589d74 (diff)
downloadsyslinux-97e12159159b793292d1f5708aab6c32f06edce4.tar.gz
syslinux-97e12159159b793292d1f5708aab6c32f06edce4.tar.xz
syslinux-97e12159159b793292d1f5708aab6c32f06edce4.zip
elflink: Fix the wrong malloc size in enter_cmdline
Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
Diffstat (limited to 'com32/elflink/ldlinux/cli.c')
-rw-r--r--com32/elflink/ldlinux/cli.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 77d32cd2..b35e958b 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -369,9 +369,8 @@ void process_command(const char *cmd, bool history)
if (history) {
struct cli_command *comm;
- comm = (struct cli_command *)malloc(sizeof(struct cli_command *));
- comm->command =
- (char *)malloc(sizeof(char) * (strlen(cmd) + 1));
+ comm = malloc(sizeof(struct cli_command));
+ comm->command = malloc(sizeof(char) * (strlen(cmd) + 1));
strcpy(comm->command, cmd);
list_add(&(comm->list), &cli_history_head);
}