Coverity analysis defect 105017: Dereference null return value

XMLWordPrintableJSON

    • ALL
    • Sharding 2018-10-22, Sharding 2018-11-05
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Return value of function which returns null is dereferenced without checking

      Defect 105017 (STATIC_C)
      Checker NULL_RETURNS (subcategory none)
      File: /src/mongo/db/s/txn_two_phase_commit_cmds.cpp
      Function mongo::<unnamed>::CoordinateCommitTransactionCmd::Invocation::typedRun(mongo::OperationContext *)
      /src/mongo/db/s/txn_two_phase_commit_cmds.cpp, line: 269
      Assigning: "txnParticipant" = null return value from "get".

                          auto txnParticipant = TransactionParticipant::get(opCtx);
      

      File: /src/mongo/db/s/txn_two_phase_commit_cmds.cpp
      Function mongo::<unnamed>::CoordinateCommitTransactionCmd::Invocation::typedRun(mongo::OperationContext *)
      /src/mongo/db/s/txn_two_phase_commit_cmds.cpp, line: 269
      Assigning: "txnParticipant" = null return value from "get".

                          auto txnParticipant = TransactionParticipant::get(opCtx);
      

              Assignee:
              Matthew Saltz (Inactive)
              Reporter:
              Coverity Collector User
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: