// preserve old tep path if no new tep is supplied
if (context_->tep_path.get().empty() &&
context_->old_manifest_data.get()->tep_name) {
+ if (context_->manifest_data.get()->tep_name)
+ free(context_->manifest_data.get()->tep_name);
context_->manifest_data.get()->tep_name =
strdup(context_->old_manifest_data.get()->tep_name);
return PMINFO_R_ERROR;
char* app_id = nullptr;
- if (pkgmgrinfo_appinfo_get_appid(handle, &app_id))
+ if (pkgmgrinfo_appinfo_get_appid(handle, &app_id)) {
+ free(application);
return PMINFO_R_ERROR;
+ }
icon_x* icon = static_cast<icon_x*>(calloc(1, sizeof(icon_x)));
- if (!icon)
+ if (!icon) {
+ free(application);
return PMINFO_R_ERROR;
+ }
char* icon_text = nullptr;
- if (pkgmgrinfo_appinfo_get_icon(handle, &icon_text))
+ if (pkgmgrinfo_appinfo_get_icon(handle, &icon_text)) {
+ free(application);
+ free(icon);
return PMINFO_R_ERROR;
+ }
if (!mfx->root_path) {
char *root_path = nullptr;
- if (pkgmgrinfo_appinfo_get_root_path(handle, &root_path))
+ if (pkgmgrinfo_appinfo_get_root_path(handle, &root_path)) {
+ free(application);
+ free(icon);
return PMINFO_R_ERROR;
+ }
mfx->root_path = strdup(root_path);
}
template<typename Type>
class Property {
public:
- Property() {}
+ Property() {} // NOLINT
Property(const Type &val): value_(val) { } // NOLINT
Property(Type &&val): value_(std::move(val)) { } // NOLINT
const Type& get() const { return value_; }