Merge "init: Remove superfluous error check"
am: 186edb1aef
Change-Id: Ia073b90dbe7ffd2443cf4d4fd183adb2223115c3
diff --git a/init/service.cpp b/init/service.cpp
index 35aaa56..c8d1cb1 100644
--- a/init/service.cpp
+++ b/init/service.cpp
@@ -889,15 +889,10 @@
}
}
- std::unique_ptr<Service> svc_p(new Service(name, "default", flags, uid, gid, supp_gids,
- no_capabilities, namespace_flags, seclabel,
- str_args));
- if (!svc_p) {
- LOG(ERROR) << "Couldn't allocate service for exec of '" << str_args[0] << "'";
- return nullptr;
- }
+ auto svc_p = std::make_unique<Service>(name, "default", flags, uid, gid, supp_gids,
+ no_capabilities, namespace_flags, seclabel, str_args);
Service* svc = svc_p.get();
- services_.push_back(std::move(svc_p));
+ services_.emplace_back(std::move(svc_p));
return svc;
}