aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Pena <felipensp@gmail.com>2014-01-29 20:16:42 +0100
committerErwan Velu <erwan@enovance.com>2014-01-29 20:16:42 +0100
commitaca39dd5d48b49658c72220fa114438c79741476 (patch)
treecdd567a3e658ca0a7115ef9de62b2b666b6da05b
parent27135b2363603b35425798c983f4041329233cca (diff)
downloadsyslinux-aca39dd5d48b49658c72220fa114438c79741476.tar.gz
syslinux-aca39dd5d48b49658c72220fa114438c79741476.tar.xz
syslinux-aca39dd5d48b49658c72220fa114438c79741476.zip
hdt: Fixing memory leak in cli
The dynamically alloc'd string to protect from strtok modification has not been free'd on start_auto_mode() function. This patch insure the free is done properly.
-rw-r--r--com32/hdt/hdt-cli.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c
index 216b6bde..2895b13c 100644
--- a/com32/hdt/hdt-cli.c
+++ b/com32/hdt/hdt-cli.c
@@ -780,6 +780,8 @@ void start_auto_mode(struct s_hardware *hardware)
mypch = strtok(NULL, AUTO_SEPARATOR);
}
+ free(temp);
+
/* Executing found commands */
for (int i = 1; i <= nb_commands; i++) {
if (commands[i]) {