char* locale = vconf_get_str(kVconfLanguageKey);
if (!locale)
locale = strdup("");
+ if (!locale) {
+ LOG(ERROR) << "Out of memory";
+ return false;
+ }
+
LOG(INFO) << "Current locale: " << locale;
if (!GetLabelInfo(parser, locale, info))
LOG(WARNING) << "Failed to get label info";
// This may be allocated by step parse
free(const_cast<char*>(manifest->installlocation));
manifest->installlocation = strdup(kAutoLocation);
+ if (!manifest->installlocation) {
+ LOG(ERROR) << "Out of memory";
+ return Status::ERROR;
+ }
+
}
return Status::OK;
}
if (app->autorestart)
free(app->autorestart);
app->autorestart = strdup("false");
+ if (!app->autorestart) {
+ LOG(ERROR) << "Out of memory";
+ xmlXPathFreeObject(xpath_obj);
+ xmlXPathFreeContext(xpath_ctx);
+ xmlFreeDoc(doc);
+ return Step::Status::ERROR;
+ }
if (app->onboot)
free(app->onboot);
app->onboot = strdup("false");
+ if (!app->onboot) {
+ LOG(ERROR) << "Out of memory";
+ xmlXPathFreeObject(xpath_obj);
+ xmlXPathFreeContext(xpath_ctx);
+ xmlFreeDoc(doc);
+ return Step::Status::ERROR;
+ }
}
xmlXPathFreeContext(xpath_ctx);
}