int ret = 0;
pkgmgrinfo_pkginfo_h pkginfo = NULL;
char pkgid[MAX_PKG_ID_LEN] = {0, };
- char *pkg_version;
+ char *pkg_version = NULL;
if (aul_app_get_pkgid_bypid_for_uid(getpid(), pkgid, sizeof(pkgid), uid) != AUL_R_OK) {
LOGE("aul_app_get_pkgid_bypid() is failed. PID %d may not be app.", getpid());
LOGE("Failed to get pkginfo\n");
} else {
ret = pkgmgrinfo_pkginfo_get_api_version(pkginfo, &pkg_version);
- if (ret != PMINFO_R_OK)
+ if (ret != PMINFO_R_OK) {
LOGE("Failed to check api version [%d]\n", ret);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo);
+ return ret;
+ }
*result = strverscmp(pkg_version, "2.4");
pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo);
{
int retval;
int return_code = ERR_ALARM_SYSTEM_FAIL;
- pkgmgrinfo_pkginfo_h handle;
+ pkgmgrinfo_pkginfo_h handle = NULL;
retval = pkgmgrinfo_pkginfo_get_usr_pkginfo(callee_pkgid, uid, &handle);
if (retval != PMINFO_R_OK) {
char *_get_pkgid_by_appid(const char *app_id, uid_t uid)
{
- pkgmgrinfo_pkginfo_h handle;
+ pkgmgrinfo_pkginfo_h handle = NULL;
char *pkgid = NULL;
- char *temp;
+ char *temp = NULL;
if (pkgmgrinfo_appinfo_get_usr_appinfo(app_id, uid, &handle) == PMINFO_R_OK) {
if (pkgmgrinfo_appinfo_get_pkgid(handle, &temp) == PMINFO_R_OK) {
int ret = 0;
pkgmgrinfo_pkginfo_h pkginfo = NULL;
char pkgid[MAX_PKG_ID_LEN] = {0, };
- char *pkg_version;
+ char *pkg_version = NULL;
if (aul_app_get_pkgid_bypid_for_uid(pid, pkgid, sizeof(pkgid), uid) != AUL_R_OK) {
LOGE("aul_app_get_pkgid_bypid() is failed. PID %d may not be app.", getpid());
if (access(tzplatform_mkpath(TZ_SYS_RO_SHARE,
"alarm-manager/alarm-config-platform-service-permitted"), F_OK) == 0) {
LOGD("This profile permit alarm for service applications which has platform cert\n");
- char *pkgid;
+ char *pkgid = NULL;
int r;
const char *cert_value;
pkgmgrinfo_certinfo_h certinfo;