Closed Bug 1240492 Opened 4 years ago Closed 4 years ago

[Static Analysis][Structurally dead code] In function ClosingService::AttachIOLayer from ClosingService.cpp

Categories

(Core :: Networking, defect)

defect
Not set

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox46 --- affected

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1348511 )

Attachments

(1 obsolete file)

The Static Analysis tool Coverity added that dead code is present after return NS_OK:

>>// static
>>nsresult
>>ClosingService::AttachIOLayer(PRFileDesc *aFd)
>>{
>>  // We are going to remove ClosingService soon.
>>  // This change is going to turn it off, so ClosingService is not used.
>>  // Bug 1238010.
>>  return NS_OK;
>>
>>  if (!sTcpUdpPRCloseLayerMethodsPtr) {
>>    return NS_OK;
>>  }
>>
>>  PRFileDesc * layer;
>>  PRStatus     status;
>>
>>  layer = PR_CreateIOLayerStub(sTcpUdpPRCloseLayerId,
>>                               sTcpUdpPRCloseLayerMethodsPtr);
>>
>>  if (!layer) {
>>    return NS_OK;
>>  }
>>
>>  ClosingLayerSecret *secret = new ClosingLayerSecret(sInstance);
>>  layer->secret = reinterpret_cast<PRFilePrivate *>(secret);
>>
>>  status = PR_PushIOLayer(aFd, PR_NSPR_IO_LAYER, layer);
>>
>>  if (status == PR_FAILURE) {
>>    delete secret;
>>    PR_DELETE(layer);
>>  }
>>  return NS_OK;
>>}

We should remove the dead code, in the future if we consider that we need it we can always rollback the file.
This is going away all together.
The code looks like this so that we can uplift it to aurora and beta. (when we return from that function earlier all ClosingService is actually not used, that is what we wanted)

Bug 1238017 - it is already in inbound but not central
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
Attachment #8708987 - Flags: review?(mcmanus)
Attachment #8708987 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.