summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-09-03 08:11:27 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-09-03 08:11:27 +0000
commitab05afe79746d9ad904315a6085238a37be60863 (patch)
tree7364595fb063a76429a4cf3c96053f86202c3b7c
parent5e427fb4b71eeab023cc704c64c5bbce61c5f8a6 (diff)
parent9e989ab695ffbc9bb4f5a41ebc13cfd61524f987 (diff)
downloadkeymaster-ab05afe79746d9ad904315a6085238a37be60863.tar.gz
release-request-b4448e78-a682-4bc1-b691-b70e74fef19f-for-git_pi-release-4314474 snap-temp-L95500000099150132
Change-Id: I9f1a2d3e017bb53ccf268ca43816a9440d5e150a
-rw-r--r--keymaster_qcom.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/keymaster_qcom.cpp b/keymaster_qcom.cpp
index b7ec9ce..0ad3330 100644
--- a/keymaster_qcom.cpp
+++ b/keymaster_qcom.cpp
@@ -172,13 +172,13 @@ static int qcom_km_get_keypair_public(const keymaster0_device_t* dev,
return -1;
}
- UniquePtr<uint8_t> key(static_cast<uint8_t*>(malloc(len)));
+ UniquePtr<unsigned char[]> key(new unsigned char[len]);
if (key.get() == NULL) {
ALOGE("Could not allocate memory for public key data");
return -1;
}
- unsigned char* tmp = reinterpret_cast<unsigned char*>(key.get());
+ unsigned char* tmp = key.get();
if (i2d_PUBKEY(pkey.get(), &tmp) != len) {
ALOGE("Len 2 returned is < 0 len = %d", len);
return -1;