build: fix memory leaks

Fix the memory leaks found by clang-3.1

Change-Id: Iaae68627ef599c324c9c9ee5737c22e92512862d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/775
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
This commit is contained in:
Spencer Oliver
2012-08-13 11:22:35 +01:00
committed by Freddie Chopin
parent fb525cdd76
commit 60a932b368
7 changed files with 46 additions and 17 deletions

View File

@@ -770,6 +770,7 @@ COMMAND_HANDLER(mg_write_cmd)
int retval = fileio_size(&fileio, &filesize);
if (retval != ERROR_OK) {
fileio_close(&fileio);
free(buffer);
return retval;
}