From 65b14f718113036173809a679f14469f6a446630 Mon Sep 17 00:00:00 2001 From: Mingjie Shen Date: Tue, 18 Apr 2023 23:59:00 -0400 Subject: [PATCH] Fix 'new[]' array freed with 'delete' 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. --- storage/kvstore/securestore/source/SecureStore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/kvstore/securestore/source/SecureStore.cpp b/storage/kvstore/securestore/source/SecureStore.cpp index b3c792991c5..be14c105f09 100644 --- a/storage/kvstore/securestore/source/SecureStore.cpp +++ b/storage/kvstore/securestore/source/SecureStore.cpp @@ -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();