Skip to content

Commit

Permalink
Fix 'new[]' array freed with 'delete'
Browse files Browse the repository at this point in the history
The array _scratch_buf is allocated using new[] in line 761 of
mbed-os/storage/kvstore/securestore/source/SecureStore.cpp.
But it was freed using delete.
  • Loading branch information
szsam committed Apr 19, 2023
1 parent 975dfcf commit 65b14f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/kvstore/securestore/source/SecureStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ int SecureStore::deinit()
mbedtls_entropy_free(_entropy);
delete _entropy;
delete _ih;
delete _scratch_buf;
delete[] _scratch_buf;
_entropy = nullptr;
}
ret = _underlying_kv->deinit();
Expand Down

0 comments on commit 65b14f7

Please sign in to comment.