ByteBuffer input;
IHmac* pHmac = null;
ByteBuffer* pChecksumByteBuffer = null;
- char* pAppId = null;
- pAppId = (char*) _StringConverter::CopyToCharArrayN(appId);
+ std::unique_ptr<char[]> pAppId(null);
+ pAppId.reset(_StringConverter::CopyToCharArrayN(appId));
SysTryCatch(NID_SEC, pAppId != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] An unexpected system error occurred.");
- memcpy(tempChecksumString, pAppId, MAX_APP_ID_SIZE);
+ memcpy(tempChecksumString, pAppId.get(), MAX_APP_ID_SIZE);
memcpy(tempChecksumString + MAX_APP_ID_SIZE, (byte*)(&visibility), sizeof(int));
- delete[] pAppId;
- pAppId = null;
-
r = input.Construct(MAX_APP_ID_SIZE + sizeof(int));
SysTryCatch(NID_SEC, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] An unexpected system error occurred.");