diff options
author | Brian Smith <brian@briansmith.org> | 2015-03-17 13:32:20 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-03-18 00:04:15 +0300 |
commit | 1d1562d9b538fd2b63ca2a0e0958080f21a41b06 (patch) | |
tree | befcea5dd44621ed7c3bd4c0908a0c0a89b62ad5 /tool | |
parent | a42b4163f85f29f882c2ca235ff6276716f300f7 (diff) |
Free new[]'d array using delete[] instead of free in speed.cc.
Change-Id: Ic3d5e8de0b6800c0852c2057427836302c1f1aaa
Reviewed-on: https://boringssl-review.googlesource.com/3962
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'tool')
-rw-r--r-- | tool/speed.cc | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/tool/speed.cc b/tool/speed.cc index dbaaf465..41a61419 100644 --- a/tool/speed.cc +++ b/tool/speed.cc @@ -166,13 +166,6 @@ static bool SpeedRSA(const std::string& key_name, RSA *key) { return true; } -template<typename T> -struct free_functor { - void operator()(T* ptr) { - free(ptr); - } -}; - static uint8_t *align(uint8_t *in, unsigned alignment) { return reinterpret_cast<uint8_t *>( (reinterpret_cast<uintptr_t>(in) + alignment) & @@ -192,10 +185,8 @@ static bool SpeedAEADChunk(const EVP_AEAD *aead, const std::string &name, memset(key.get(), 0, key_len); std::unique_ptr<uint8_t[]> nonce(new uint8_t[nonce_len]); memset(nonce.get(), 0, nonce_len); - std::unique_ptr<uint8_t, free_functor<uint8_t>> in_storage( - new uint8_t[chunk_len + kAlignment]); - std::unique_ptr<uint8_t, free_functor<uint8_t>> out_storage( - new uint8_t[chunk_len + overhead_len + kAlignment]); + std::unique_ptr<uint8_t[]> in_storage(new uint8_t[chunk_len + kAlignment]); + std::unique_ptr<uint8_t[]> out_storage(new uint8_t[chunk_len + overhead_len + kAlignment]); std::unique_ptr<uint8_t[]> ad(new uint8_t[ad_len]); memset(ad.get(), 0, ad_len); |