[SERVER-18713] Coverity analysis defect 72709: Resource leak Created: 28/May/15  Updated: 28/May/15  Resolved: 28/May/15

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

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

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Leak of memory or pointers to system resources

Defect 72709 (STATIC_C)
Checker RESOURCE_LEAK (subcategory none)
File: /src/mongo/db/query/lite_parsed_query_test.cpp
Function <unnamed>::UnitTest_LiteParsedQueryTest_ParseCommandAwaitDataButNotTailable::_doTest()
/src/mongo/db/query/lite_parsed_query_test.cpp, line: 838
Variable "rawLpq" going out of scope leaks the storage it points to.

        }



 Comments   
Comment by David Storch [ 28/May/15 ]

This is a false positive. When LiteParsedQuery::make() returns a non-OK status, the caller does not receive ownership of the LiteParsedQuery out-parameter. If the test succeeds, then there will be no leak. If the test fails, then there would be a leak, but I think first we'd notice that the unit tests were broken

The ownership here is not great so it's understandable that Coverity is confused. We're hoping to clean this up under SERVER-16889.

Generated at Thu Feb 08 03:48:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.