Fix memory leakage with MBR on exiting error path

pull/7384/head
ccli8 2018-07-02 11:29:29 +08:00
parent 2da597e56a
commit 7cc1245308
1 changed files with 1 additions and 0 deletions

View File

@ -242,6 +242,7 @@ int MBRBlockDevice::init()
// Check that block addresses are valid
if (!_bd->is_valid_erase(_offset, _size)) {
delete[] buffer;
return BD_ERROR_INVALID_PARTITION;
}