From aca39dd5d48b49658c72220fa114438c79741476 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Wed, 29 Jan 2014 20:16:42 +0100 Subject: 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. --- com32/hdt/hdt-cli.c | 2 ++ 1 file changed, 2 insertions(+) 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]) { -- cgit v1.2.1