Fix memory leakage with MBR on exiting error path

pull/7518/head
ccli8 2018-07-02 11:29:29 +08:00 committed by Cruz Monrreal II
parent 83cd02e501
commit 6de4b3532c
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;
}