summaryrefslogtreecommitdiff
path: root/src/flash/flash.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-05-20 10:10:54 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-05-20 10:10:54 +0000
commit0485363c457fd42f38e94ee6b7190c89a4aa762f (patch)
tree0816f27dc3751362b13bc08e3c0580173eb1f0cb /src/flash/flash.c
parent0989c374e91fb7c743c8f791e55fcca935351e9d (diff)
downloadopenocd+libswd-0485363c457fd42f38e94ee6b7190c89a4aa762f.tar.gz
openocd+libswd-0485363c457fd42f38e94ee6b7190c89a4aa762f.tar.bz2
openocd+libswd-0485363c457fd42f38e94ee6b7190c89a4aa762f.tar.xz
openocd+libswd-0485363c457fd42f38e94ee6b7190c89a4aa762f.zip
Edgar Grimberg fixes some memory handling issues and
a problem with arm7_9_debug_entry not executing a code path upon crashes. git-svn-id: svn://svn.berlios.de/openocd/trunk@669 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash/flash.c')
-rw-r--r--src/flash/flash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/flash/flash.c b/src/flash/flash.c
index 3478b6a2..3b2abe23 100644
--- a/src/flash/flash.c
+++ b/src/flash/flash.c
@@ -829,12 +829,15 @@ int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd
buffer = malloc(fileio.size);
if (fileio_read(&fileio, fileio.size, buffer, &buf_cnt) != ERROR_OK)
{
+ free(buffer);
+ fileio_close(&fileio);
return ERROR_OK;
}
retval = flash_driver_write(p, buffer, offset, buf_cnt);
free(buffer);
+ buffer = NULL;
duration_stop_measure(&duration, &duration_text);
if (retval!=ERROR_OK)