From fef908e5a50a4026bb94edabb8f500a959b9ed0e Mon Sep 17 00:00:00 2001 From: Andres Morales Date: Tue, 7 Jul 2015 10:28:15 -0700 Subject: [PATCH] [gatekeeperd] fix use of uninitialized memory Bug: 22319772 Change-Id: I3cb83389f11e54867aca132de48a3f6407b7eaf3 --- gatekeeperd/gatekeeperd.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gatekeeperd/gatekeeperd.cpp b/gatekeeperd/gatekeeperd.cpp index 6622df979..c91b3004c 100644 --- a/gatekeeperd/gatekeeperd.cpp +++ b/gatekeeperd/gatekeeperd.cpp @@ -50,6 +50,8 @@ class GateKeeperProxy : public BnGateKeeperService { public: GateKeeperProxy() { int ret = hw_get_module_by_class(GATEKEEPER_HARDWARE_MODULE_ID, NULL, &module); + device = NULL; + if (ret < 0) { ALOGW("falling back to software GateKeeper"); soft_device.reset(new SoftGateKeeperDevice());