[SERVER-28834] Coverity analysis defect 101485: Wrapper object use after free Created: 18/Apr/17  Updated: 29/Jan/18  Resolved: 18/Apr/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Randolph Tan
Resolution: Won't Fix Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2017-05-08
Participants:

 Description   

An internal pointer of a wrapper object remains available after the object is freed

Defect 101485 (STATIC_C)
Checker WRAPPER_ESCAPE (subcategory none)
File: /src/mongo/s/sharding_test_fixture.cpp
Function mongo::ShardingTestFixture::setUp()
/src/mongo/s/sharding_test_fixture.cpp, line: 132
The internal representation of local "fixedExec" escapes into "this->_executor", but is destroyed when it exits scope.

        _executor = fixedExec.get();



 Comments   
Comment by Randolph Tan [ 18/Apr/17 ]

Marked as ignored in Coverity.

Comment by Eric Milkie [ 18/Apr/17 ]

While this is technically a false positive, as we std::move the unique pointer and stash it away somewhere later on in the function, I'm not sure we want to let this pattern proliferate.

Generated at Thu Feb 08 04:19:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.