Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8a9f4ad authored by Chris Thornton's avatar Chris Thornton
Browse files

Fix potential null dereference in SoundTriggerHwService

Identified by static analysis as a potential problem.

Test: mmma frameworks/av/services/soundtrigger
Change-Id: If24519faeec260c3d357b369d53d0f68689bdf8a
parent db0d4cc3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -923,7 +923,10 @@ SoundTriggerHwService::ModuleClient::ModuleClient(const sp<Module>& module,

void SoundTriggerHwService::ModuleClient::onFirstRef()
{
    IInterface::asBinder(mClient)->linkToDeath(this);
    sp<IBinder> binder = IInterface::asBinder(mClient);
    if (binder != 0) {
        binder->linkToDeath(this);
    }
}

SoundTriggerHwService::ModuleClient::~ModuleClient()