Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1897

Coverity analysis defect 72313: Logically dead code

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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);
      

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: