From 7e4cf8db585841985115a6835d403613487993a2 Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Mon, 4 Oct 2010 20:35:33 +0100 Subject: gdbserver: fix gdb_port memory leak Signed-off-by: Spencer Oliver --- src/server/gdb_server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 51809026..74dec63c 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2466,8 +2466,10 @@ COMMAND_HANDLER(handle_gdb_sync_command) COMMAND_HANDLER(handle_gdb_port_command) { int retval = CALL_COMMAND_HANDLER(server_pipe_command, &gdb_port); - if (ERROR_OK == retval) + if (ERROR_OK == retval) { + free((void*)gdb_port_next); gdb_port_next = strdup(gdb_port); + } return retval; } -- cgit v1.2.3