summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2017-09-01 18:16:44 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-09-01 18:16:44 +0000
commit6a7d20c2576dabdcfc0447c776a7d75688f8927d (patch)
tree7364595fb063a76429a4cf3c96053f86202c3b7c
parent5e427fb4b71eeab023cc704c64c5bbce61c5f8a6 (diff)
parent86167196711365710befb5b3989c141d463802f8 (diff)
downloadkeymaster-6a7d20c2576dabdcfc0447c776a7d75688f8927d.tar.gz
Merge "Fix a mismatched malloc/delete" am: 619ac6c26b am: 05033f69eb
am: 8616719671 Change-Id: I8df22036c19841a592e5d6047ce96e1cff7cf859
-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;