projects
/
platform
/
core
/
appfw
/
pkgmgr-info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix static analysis issue
[platform/core/appfw/pkgmgr-info.git]
/
src
/
pkgmgrinfo_appinfo.c
diff --git
a/src/pkgmgrinfo_appinfo.c
b/src/pkgmgrinfo_appinfo.c
index
ad93c86
..
b50e08d
100644
(file)
--- a/
src/pkgmgrinfo_appinfo.c
+++ b/
src/pkgmgrinfo_appinfo.c
@@
-786,8
+786,21
@@
static int _pkgmgrinfo_get_appinfo(const char *appid, uid_t uid,
}
info->app_info = (application_x *)g_hash_table_lookup(list, appid);
}
info->app_info = (application_x *)g_hash_table_lookup(list, appid);
+ if (!info->app_info || !info->app_info->package) {
+ _LOGD("appinfo for [%s] is not existed for user [%d]",
+ appid, uid);
+ g_hash_table_destroy(list);
+ free(locale);
+ return PMINFO_R_ENOENT;
+ }
info->locale = locale;
info->package = strdup(info->app_info->package);
info->locale = locale;
info->package = strdup(info->app_info->package);
+ if (!info->package) {
+ _LOGE("out of memory");
+ g_hash_table_destroy(list);
+ free(locale);
+ return PMINFO_R_ERROR;
+ }
/* just free list only */
g_hash_table_steal(list, (gconstpointer)appid);
/* just free list only */
g_hash_table_steal(list, (gconstpointer)appid);