Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-89331

Coverity analysis defect 141172: Wrapper object use after free

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 7.3.3, 8.0.0-rc5
    • Affects Version/s: 8.0.0-rc0
    • Component/s: None
    • Cluster Scalability
    • Fully Compatible
    • ALL
    • v8.0, v7.3

      Wrapper object use after free

      A use after free bug would occur if the internal pointer is used. An internal pointer of a wrapper object remains available after the object is freed
      /src/mongo/db/s/resharding/resharding_recipient_service.cpp:1594: WRAPPER_ESCAPE 141172 Calling "get" which extracts wrapped state from temporary of type "mongo::ServiceContext::UniqueOperationContext".
      /src/mongo/db/s/resharding/resharding_recipient_service.cpp:1594: WRAPPER_ESCAPE 141172 Assigning: "opCtx" = "mongo::ServiceContext::UniqueOperationContext(mongo::cc()->makeOperationContext()).get()".
      /src/mongo/db/s/resharding/resharding_recipient_service.cpp:1594: WRAPPER_ESCAPE 141172 The internal representation of temporary of type "mongo::ServiceContext::UniqueOperationContext" is freed by its destructor.
      /src/mongo/db/s/resharding/resharding_recipient_service.cpp:1596: WRAPPER_ESCAPE 141172 Using internal representation of destroyed object temporary of type "mongo::ServiceContext::UniqueOperationContext".

            Assignee:
            ben.gawel@mongodb.com Ben Gawel
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: