privacyInfo.privacy_id = pPrivacyId.get();
ret = privacy_info_client_get_privacy_display_name(&privacyInfo, &pPrivacyDisplayName);
SysTryReturn(NID_SEC, ret == PRIV_MGR_ERROR_SUCCESS, displayName, E_SYSTEM, "[E_SYSTEM] An unexpected system error occurred.");
-
displayName.Append(pPrivacyDisplayName);
+
+ if (pPrivacyDisplayName != null)
+ {
+ free(pPrivacyDisplayName);
+ }
+
return displayName;
}
ByteBuffer input;
std::unique_ptr<IHash> pHash(null);
std::unique_ptr<ByteBuffer> pChecksumByteBuffer(null);
- std::unique_ptr<char> pAppId(null);
+ std::unique_ptr<char[]> pAppId(null);
SysTryReturnResult(NID_SEC, length <= MAX_BITWISE_PRIV_SIZE, E_INVALID_ARG, "The privilege information of %ls is invalid.", appId.GetPointer());
pPrivilegeList = new ArrayList;
r = pPrivilegeList->Construct();
- IEnumerator* pEnum = tempPrivilegeList.GetEnumeratorN();
+ std::unique_ptr<IEnumerator> pEnum(null);
+ pEnum.reset(tempPrivilegeList.GetEnumeratorN());
+ SysTryReturnResult(NID_SEC, pEnum != null, E_SYSTEM, "An unexpected system error occurred.");
+
while (pEnum->MoveNext() == E_SUCCESS)
{
String* tempString = static_cast< String* >(pEnum->GetCurrent());
pPrivilegeList = new ArrayList;
r = pPrivilegeList->Construct();
- IEnumerator* pEnum = tempPrivilegeList.GetEnumeratorN();
+ std::unique_ptr<IEnumerator> pEnum(null);
+ pEnum.reset(tempPrivilegeList.GetEnumeratorN());
+ SysTryReturnResult(NID_SEC, pEnum != null, E_SYSTEM, "An unexpected system error occurred.");
+
while (pEnum->MoveNext() == E_SUCCESS)
{
String* tempString = static_cast< String* >(pEnum->GetCurrent());