diff --git a/trusty/gatekeeper/trusty_gatekeeper.cpp b/trusty/gatekeeper/trusty_gatekeeper.cpp index d14966460..e416fb2ac 100644 --- a/trusty/gatekeeper/trusty_gatekeeper.cpp +++ b/trusty/gatekeeper/trusty_gatekeeper.cpp @@ -56,9 +56,9 @@ TrustyGateKeeperDevice::~TrustyGateKeeperDevice() { SizedBuffer hidl_vec2sized_buffer(const hidl_vec& vec) { if (vec.size() == 0 || vec.size() > std::numeric_limits::max()) return {}; - auto dummy = new uint8_t[vec.size()]; - std::copy(vec.begin(), vec.end(), dummy); - return {dummy, static_cast(vec.size())}; + auto buffer = new uint8_t[vec.size()]; + std::copy(vec.begin(), vec.end(), buffer); + return {buffer, static_cast(vec.size())}; } Return TrustyGateKeeperDevice::enroll(uint32_t uid,