aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Pena <felipensp@gmail.com>2014-01-29 20:16:42 +0100
committerGene Cumm <gene.cumm@gmail.com>2014-02-01 07:59:19 -0500
commitcee0d66107fcd29c7ad4df0572d190a83917f29d (patch)
tree5dc62d13796084cb127caae7eb07e130e4372431
parent1503ab96d07ff9e7120d74ed013216c9d4b1bab8 (diff)
downloadsyslinux-cee0d66107fcd29c7ad4df0572d190a83917f29d.tar.gz
syslinux-cee0d66107fcd29c7ad4df0572d190a83917f29d.tar.xz
syslinux-cee0d66107fcd29c7ad4df0572d190a83917f29d.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 7542da83..8c43800a 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]) {