From: hb.min Date: Thu, 13 Jun 2013 03:58:59 +0000 (+0900) Subject: Fix prevent defect X-Git-Tag: submit/tizen_2.2/20130714.152805~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62f853c85965822a9aa850507bb63cb77e9c167a;p=framework%2Fosp%2Fappfw.git Fix prevent defect Change-Id: I2d8a7ace3a999b7b171c62cc58373a5edd2c911f Signed-off-by: hb.min --- diff --git a/src/server/security/FSec_PrivilegeManagerServer.cpp b/src/server/security/FSec_PrivilegeManagerServer.cpp index 4fcfd45..b6fcecc 100644 --- a/src/server/security/FSec_PrivilegeManagerServer.cpp +++ b/src/server/security/FSec_PrivilegeManagerServer.cpp @@ -196,17 +196,14 @@ _PrivilegeManagerServer::GetChecksum(AppId appId, int visibility, String& checks ByteBuffer input; IHmac* pHmac = null; ByteBuffer* pChecksumByteBuffer = null; - char* pAppId = null; - pAppId = (char*) _StringConverter::CopyToCharArrayN(appId); + std::unique_ptr 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.");