From: Liu Aleaxander Date: Tue, 15 Mar 2011 20:24:57 +0000 (+0000) Subject: elflink: Fix the wrong malloc size in enter_cmdline X-Git-Tag: syslinux-5.00-pre1~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97e12159159b793292d1f5708aab6c32f06edce4;p=platform%2Fupstream%2Fsyslinux.git elflink: Fix the wrong malloc size in enter_cmdline Signed-off-by: Liu Aleaxander Signed-off-by: Matt Fleming --- diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c index 77d32cd..b35e958 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); }