diff options
author | Spencer Oliver <spen@spen-soft.co.uk> | 2013-08-16 15:37:32 +0100 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-08-29 13:02:42 +0000 |
commit | f4943acd650a5dea16978cf21132b72bdd0f72c9 (patch) | |
tree | 241b14232ffa590abc0f33aaa4383306bf4c4a73 | |
parent | d79bfbb0888be57cb402c6d154d10b4f8e2151d9 (diff) | |
download | riscv-openocd-f4943acd650a5dea16978cf21132b72bdd0f72c9.zip riscv-openocd-f4943acd650a5dea16978cf21132b72bdd0f72c9.tar.gz riscv-openocd-f4943acd650a5dea16978cf21132b72bdd0f72c9.tar.bz2 |
gdb server: do not free tdesc_filename early
Issue caught by clang.
Change-Id: I4fb331574512140b36e56b3b7ab7e8bdad5e013d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1554
Tested-by: jenkins
-rw-r--r-- | src/server/gdb_server.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 48015ab..ab7d40d 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2936,16 +2936,16 @@ COMMAND_HANDLER(handle_gdb_save_tdesc_command) int retval = fileio_open(&fileio, tdesc_filename, FILEIO_WRITE, FILEIO_TEXT); - free(tdesc_filename); - if (retval != ERROR_OK) { LOG_WARNING("Can't open %s for writing", tdesc_filename); + free(tdesc_filename); return ERROR_FAIL; } retval = fileio_write(&fileio, tdesc_length, tdesc, &size_written); fileio_close(&fileio); + free(tdesc_filename); if (retval != ERROR_OK) { LOG_WARNING("Error while writing the tdesc file"); |