gdbserver: fix gdb_port memory leak

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
__archive__
Spencer Oliver 2010-10-04 20:35:33 +01:00
parent 45de3b1fbe
commit 7e4cf8db58
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}