fixed memory leak introduced by previous commit

FE_402_fix
Gleb Gagarin 2017-08-10 16:37:50 -07:00
parent b5692585de
commit 39b01259fa
1 changed files with 2 additions and 0 deletions

View File

@ -1416,6 +1416,7 @@ static int read_memory(struct target *target, target_addr_t address,
riscv013_clear_abstract_error(target); riscv013_clear_abstract_error(target);
increase_ac_busy_delay(target); increase_ac_busy_delay(target);
retry_batch_transaction = true; retry_batch_transaction = true;
riscv_batch_free(batch);
break; break;
default: default:
LOG_ERROR("error when reading memory, abstractcs=0x%08lx", (long)abstractcs); LOG_ERROR("error when reading memory, abstractcs=0x%08lx", (long)abstractcs);
@ -1423,6 +1424,7 @@ static int read_memory(struct target *target, target_addr_t address,
riscv_set_register(target, GDB_REGNO_S0, s0); riscv_set_register(target, GDB_REGNO_S0, s0);
riscv_set_register(target, GDB_REGNO_S1, s1); riscv_set_register(target, GDB_REGNO_S1, s1);
riscv013_clear_abstract_error(target); riscv013_clear_abstract_error(target);
riscv_batch_free(batch);
return ERROR_FAIL; return ERROR_FAIL;
} }
if (retry_batch_transaction) continue; if (retry_batch_transaction) continue;