Fix NULL Pointer dereference when memory allocation fails
Change-Id: If23103d7135852ba98cc52173982cdc5bca47ca0
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
RequestMode request_mode) {
manifest_x* manifest =
static_cast<manifest_x*>(calloc(1, sizeof(manifest_x)));
+ if (!manifest) {
+ LOG(ERROR) << "Out of memory";
+ return false;
+ }
PkgmgrGenerateManifestInfoFromDB(manifest, pkgid, uid);
bool res = UnregisterAppInPkgmgr(manifest, pkgid, uid, request_mode);
pkgmgr_parser_free_manifest_xml(manifest);
context_->force_clean_from_db.set(true);
manifest_x* manifest =
static_cast<manifest_x*>(calloc(1, sizeof(manifest_x)));
+ if (!manifest) {
+ LOG(ERROR) << "Out of memory";
+ return Status::ERROR;
+ }
if (!PkgmgrGenerateManifestInfoFromDB(manifest, context_->pkgid.get(),
context_->uid.get())) {
context_->manifest_data.set(manifest);