- Remove false initialization
- Add NULL initialization at gslist
- Change adding new updateinof into list from append to prepend
for performance
Change-Id: I7823fb892646b5b32118943ae271c7f6abb871a8
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
return -1;
}
update_info->type = convert_type;
return -1;
}
update_info->type = convert_type;
- *update_info_list = g_slist_append(*update_info_list, update_info);
+ *update_info_list = g_slist_prepend(*update_info_list,
+ update_info);
pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
{
int ret;
pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
{
int ret;
+ GSList *info_list = NULL;
GSList *tmp_list;
if (callback == NULL)
return PMINFO_R_EINVAL;
GSList *tmp_list;
if (callback == NULL)
return PMINFO_R_EINVAL;
- info_list = calloc(1, sizeof(updateinfo_x));
- if (info_list == NULL) {
- _LOGE("Out of memory");
- return PMINFO_R_ERROR;
- }
-
ret = _get_pkg_updateinfo_from_db(NULL, &info_list, uid);
if (ret != 0) {
_LOGE("Failed to get pkg update info for user[%d]", (int)uid);
ret = _get_pkg_updateinfo_from_db(NULL, &info_list, uid);
if (ret != 0) {
_LOGE("Failed to get pkg update info for user[%d]", (int)uid);