Open Bug 2089954 Opened 14 days ago

Remove the dead aManager null check in IProtocol::SetManagerAndRegister

Categories

(Core :: IPC, task)

task

Tracking

()

People

(Reporter: Sylvestre, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [lang=c++])

Filing as a good first bug to learn workflows.

SetManagerAndRegister calls SetManager(aManager) first, which dereferences aManager unconditionally, so the later aManager && is dead. Drop it (optionally add MOZ_ASSERT(aManager) at the top).

Current code:

  // If our manager is already dying, mark ourselves as doomed as well.
  if (aManager && aManager->mLinkStatus != LinkStatus::Connected) {
    mLinkStatus = LinkStatus::Doomed;

Link to the code:
https://searchfox.org/firefox-main/source/ipc/glue/ProtocolUtils.cpp

To verify the fix:

./mach build

This was reported by Coverity Scan (CID 1648341). The analyzer will stop reporting it once the change lands.

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

You need to log in before you can comment on or make changes to this bug.