mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-28 21:50:35 +00:00
Remove unnecessary null pointer checks (#6358)
As reported by @elfring, we had several points in our code where it was unnecessary to check pointers were non-null before deleting them. Fixes https://github.com/meshtastic/firmware/issues/6170
This commit is contained in:
@@ -161,10 +161,8 @@ void CryptoEngine::hash(uint8_t *bytes, size_t numBytes)
|
||||
|
||||
void CryptoEngine::aesSetKey(const uint8_t *key_bytes, size_t key_len)
|
||||
{
|
||||
if (aes) {
|
||||
delete aes;
|
||||
aes = nullptr;
|
||||
}
|
||||
delete aes;
|
||||
aes = nullptr;
|
||||
if (key_len != 0) {
|
||||
aes = new AESSmall256();
|
||||
aes->setKey(key_bytes, key_len);
|
||||
|
||||
Reference in New Issue
Block a user