Merge pull request #7384 from OpenNuvoton/nuvoton_fix_mbr_memleak

Fix memory leakage with MBR on exiting error path
pull/7411/head
Cruz Monrreal 2018-07-03 07:37:43 -05:00 committed by GitHub
commit b50f09d57d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}