API int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
{
pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+ char *temp = NULL;
retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
retvm_if(size == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
- if (info->pkg_info == NULL || info->pkg_info->package_size == NULL)
+ if (info->pkg_info == NULL)
return PMINFO_R_ERROR;
+ if (info->pkg_info->package_size == NULL) {
+ temp = strdup("");
+ if (temp == NULL) {
+ _LOGE("out of memory");
+ return PMINFO_R_ERROR;
+ } else {
+ info->pkg_info->package_size = temp;
+ }
+ }
+
*size = atoi((char *)info->pkg_info->package_size);
return PMINFO_R_OK;
for (tmp = info->pkg_info->icon; tmp; tmp = tmp->next) {
ptr = (icon_x *)tmp->data;
+ if (ptr && ptr->text == NULL)
+ ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
!strcasecmp(ptr->text, "(null)") ||
strcmp(ptr->lang, locale))
locale = DEFAULT_LOCALE;
for (tmp = info->pkg_info->icon; tmp; tmp = tmp->next) {
ptr = (icon_x *)tmp->data;
+ if (ptr && ptr->text == NULL)
+ ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;
for (tmp = info->pkg_info->label; tmp != NULL; tmp = tmp->next) {
ptr = (label_x *)tmp->data;
+ if (ptr && ptr->text == NULL)
+ ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;
locale = DEFAULT_LOCALE;
for (tmp = info->pkg_info->label; tmp != NULL; tmp = tmp->next) {
ptr = (label_x *)tmp->data;
+ if (ptr && ptr->text == NULL)
+ ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;
for (tmp = info->pkg_info->description; tmp; tmp = tmp->next) {
ptr = (description_x *)tmp->data;
+ if (ptr && ptr->text == NULL)
+ ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;
locale = DEFAULT_LOCALE;
for (tmp = info->pkg_info->description; tmp; tmp = tmp->next) {
ptr = (description_x *)tmp->data;
+ if (ptr && ptr->text == NULL)
+ ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;