summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2017-08-29 14:13:20 -0700
committerGeorge Burgess IV <gbiv@google.com>2017-08-29 14:13:20 -0700
commitcfa8a4123c34ee89af12edd656b0bdfcd8cd594b (patch)
tree1cbf5163e7c5901e26f1dd5a2a4f45d26a2e138c
parent77d09b78afdb4d94665eca299edbc647517e7b10 (diff)
downloadgatekeeper-cfa8a4123c34ee89af12edd656b0bdfcd8cd594b.tar.gz
gatekeeper: fix new[]/delete mismatchandroid-o-mr1-preview-2android-o-mr1-preview-1
UniquePtr<T[]> uses delete[], whereas UniquePtr<T> uses delete. Since we're using new[], we should be using delete[]. Caught by clang's static analyzer. Bug: 27101951 Test: mma. Static analyzer warning is gone. Change-Id: I30a72b8c111764f602aeee7c09fc2ce781ad58cb
-rw-r--r--gatekeeper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gatekeeper.cpp b/gatekeeper.cpp
index cfd878f..3b5868e 100644
--- a/gatekeeper.cpp
+++ b/gatekeeper.cpp
@@ -182,7 +182,7 @@ bool GateKeeper::CreatePasswordHandle(SizedBuffer *password_handle_buffer, salt_
uint32_t metadata_length = sizeof(user_id) + sizeof(flags) + sizeof(HANDLE_VERSION);
const size_t to_sign_size = password_length + metadata_length;
- UniquePtr<uint8_t> to_sign(new uint8_t[to_sign_size]);
+ UniquePtr<uint8_t[]> to_sign(new uint8_t[to_sign_size]);
if (to_sign.get() == nullptr) {
return false;