forked from auracaster/openocd
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:
committed by
Freddie Chopin
parent
fb525cdd76
commit
60a932b368
@@ -897,8 +897,10 @@ static int at91sam7_erase(struct flash_bank *bank, int first, int last)
|
||||
for (pos = 0; pos < nbytes; pos++)
|
||||
buffer[pos] = 0xFF;
|
||||
|
||||
if (at91sam7_write(bank, buffer, bank->sectors[first].offset, nbytes) != ERROR_OK)
|
||||
if (at91sam7_write(bank, buffer, bank->sectors[first].offset, nbytes) != ERROR_OK) {
|
||||
free(buffer);
|
||||
return ERROR_FLASH_OPERATION_FAILED;
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user