diff --git a/light/aidl/main.cpp b/light/aidl/main.cpp index 5bab50d7..95cb6d85 100644 --- a/light/aidl/main.cpp +++ b/light/aidl/main.cpp @@ -24,6 +24,9 @@ using ::aidl::android::hardware::light::Lights; int main() { ABinderProcess_setThreadPoolMaxThreadCount(0); std::shared_ptr lights = ndk::SharedRefBase::make(); + if (!lights) { + return EXIT_FAILURE; + } const std::string instance = std::string() + Lights::descriptor + "/default"; binder_status_t status = AServiceManager_addService(lights->asBinder().get(), instance.c_str());