[CDRIVER-1897] Coverity analysis defect 72313: Logically dead code Created: 02/Nov/16  Updated: 07/Nov/16  Resolved: 07/Nov/16

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Code can never be reached because of a logical contradiction

Defect 72313 (STATIC_C)
Checker DEADCODE (subcategory none)
File: /examples/example-scram.c
Function main
/examples/example-scram.c, line: 14
Assigning: "database" = "NULL".

       mongoc_database_t *database = NULL;

/examples/example-scram.c, line: 62
Assigning: "database" = "NULL".

       database = NULL;

/examples/example-scram.c, line: 95
At condition "database", the value of "database" must be "NULL".

       if (database) {

/examples/example-scram.c, line: 95
The condition "database" cannot be true.

       if (database) {

/examples/example-scram.c, line: 96
Execution cannot reach this statement: "mongoc_database_destroy(dat...".

          mongoc_database_destroy (database);



 Comments   
Comment by Githook User [ 07/Nov/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1897 Logically dead code
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/b36a8d8d555414ad670997114547ebc8a28bddb7

Generated at Wed Feb 07 21:13:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.