[SERVER-11542] Coverity analysis defect 15610: Resource leak candidateExplain Created: 04/Nov/13  Updated: 11/Jul/16  Resolved: 21/Nov/13

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

Type: Bug Priority: Major - P3
Reporter: auto Assignee: Benety Goh
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   

A new defect has been detected and assigned to hari.khalsa@10gen.com in Coverity Connect http://coverity.mongodb.com//sourcebrowser.htm?projectId=10001#mergedDefectId=15610
The defect was flagged by checker RESOURCE_LEAK in
file /src/mongo/db/query/multi_plan_runner.cpp
function mongo::MultiPlanRunner::getExplainPlan(mongo::TypeExplain **) const
and this ticket was created by matt.kangas@10gen.com

https://github.com/mongodb/mongo/blame/master/src/mongo/db/query/multi_plan_runner.cpp#L472-L477

            TypeExplain* candidateExplain;
            status = explainPlan(**it, &candidateExplain, false /* no full details */);
            if (status != Status::OK()) {
                continue;
            }

12. alloc_arg: "mongo::explainPlan(mongo::PlanStageStats const &, mongo::TypeExplain **, bool)" allocates memory that is stored into "candidateExplain".
CID 15610 (#1 of 1): Resource leak (RESOURCE_LEAK)15. leaked_storage: Variable "candidateExplain" going out of scope leaks the storage it points to.



 Comments   
Comment by Githook User [ 21/Nov/13 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-11542 fixed coverity warning on potential resource leak
Branch: master
https://github.com/mongodb/mongo/commit/634b34eb69d8e05065ad38b878fe9e2e662e1620

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