summaryrefslogtreecommitdiff
path: root/keymaster_qcom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'keymaster_qcom.cpp')
-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;