Skip to content

Commit b50f09d

Browse files
author
Cruz Monrreal
authored
Merge pull request #7384 from OpenNuvoton/nuvoton_fix_mbr_memleak
Fix memory leakage with MBR on exiting error path
2 parents 7e0f75e + 7cc1245 commit b50f09d

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)