#include <wgt_manifest_handlers/w3c_pc_utils.h>
#include <pkgmgr/pkgmgr_parser.h>
+#include <pkgmgrinfo_basic.h>
#include <string.h>
application->launch_mode = strdup(app_info->launch_mode().c_str());
for (auto& icon : GListRange<icon_x*>(manifest->icon)) {
icon_x* app_icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
- if (!app_icon)
+ if (!app_icon) {
+ LOG(ERROR) << "Out of memory";
+ pkgmgrinfo_basic_free_application(application);
return false;
+ }
app_icon->text = strdup(icon->text);
app_icon->lang = strdup(icon->lang);
application->icon = g_list_append(application->icon, app_icon);
bf::path icon_path = context_->root_application_path.get()
/ manifest->package / "res" / "wgt" / service_info.icon();
icon_x* icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
- if (!icon)
+ if (!icon) {
+ LOG(ERROR) << "Out of memory";
+ pkgmgrinfo_basic_free_application(application);
return false;
+ }
icon->text = strdup(icon_path.c_str());
icon->lang = strdup(DEFAULT_LOCALE);
application->icon = g_list_append(application->icon, icon);
if (!app_widget.icon_src.empty()) {
icon_x* icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
- if (!icon)
+ if (!icon) {
+ LOG(ERROR) << "Out of memory";
+ pkgmgrinfo_basic_free_application(application);
return false;
+ }
icon->text = strdup(app_widget.icon_src.c_str());
icon->lang = strdup(DEFAULT_LOCALE);
application->icon = g_list_append(application->icon, icon);