diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index ecbcf00aa..22c1710ad 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -814,6 +814,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command) if (buf_cnt != length) { LOG_ERROR("Short read"); free(buffer); + fileio_close(fileio); return ERROR_FAIL; }