pAppId = _StringConverter::CopyToCharArrayN(packageId);
ret = privacy_manager_client_foreach_get_privacy_info(pAppId, GetPrivacyInfoListNCallback, (void *)pPrivacyIdList);
- delete pAppId;
+ delete[] pAppId;
return pPrivacyIdList;
}
isEnabled = privacyInfo.IsEnabled();
ret = privacy_manager_client_set_package_privacy(pPackageId, pPrivacyId, isEnabled);
+
+ delete[] pPackageId;
+ delete[] pPrivacyId;
return r;
}
std::unique_ptr<IEnumerator> pEnum(null);
r = pPrivilegeInfo->__privilegeList.Construct();
- SysTryReturn(NID_SEC, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] An unexpected system error occurred.");
+ SysTryCatch(NID_SEC, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] An unexpected system error occurred.");
pEnum.reset(this->__privilegeList.GetEnumeratorN());
- SysTryReturn(NID_SEC, pEnum != null, null, E_SYSTEM, "[E_SYSTEM] An unexpected system error occurred.");
+ SysTryCatch(NID_SEC, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] An unexpected system error occurred.");
while (pEnum->MoveNext() == E_SUCCESS)
{
}
return pPrivilegeInfo;
+
+CATCH:
+
+ SetLastResult(r);
+
+ delete pPrivilegeInfo;
+ return null;
}
result