Skip to content

Commit 7cc1245

Browse files
committed
Fix memory leakage with MBR on exiting error path
1 parent 2da597e commit 7cc1245

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

features/filesystem/bd/MBRBlockDevice.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ int MBRBlockDevice::init()
242242

243243
// Check that block addresses are valid
244244
if (!_bd->is_valid_erase(_offset, _size)) {
245+
delete[] buffer;
245246
return BD_ERROR_INVALID_PARTITION;
246247
}
247248

0 commit comments

Comments
 (0)