{
GHashTable *list;
int ret;
+ int query_count;
pkgmgrinfo_filter_x *filter;
if (handle == NULL || count == NULL) {
}
ret = _appinfo_get_applications(uid, uid, filter, 0, list);
- if (ret != PMINFO_R_OK) {
- g_hash_table_destroy(list);
- return PMINFO_R_ERROR;
- }
-
- *count = g_hash_table_size(list);
+ query_count = g_hash_table_size(list);
g_hash_table_destroy(list);
+ if (ret == PMINFO_R_ERROR)
+ return ret;
+ *count = query_count;
return PMINFO_R_OK;
}
API int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
{
int ret;
+ int query_count;
GHashTable *list = NULL;
if (handle == NULL || count == NULL) {
}
ret = _pkginfo_get_packages(uid, handle, PMINFO_PKGINFO_GET_BASICINFO, list);
- if (ret != PMINFO_R_OK) {
- g_hash_table_destroy(list);
- return PMINFO_R_ERROR;
- }
- *count = g_hash_table_size(list);
-
+ query_count = g_hash_table_size(list);
g_hash_table_destroy(list);
-
+ if (ret == PMINFO_R_ERROR)
+ return ret;
+ *count = query_count;
return PMINFO_R_OK;
}