[SERVER-20004] Coverity analysis defect 73593: Resource leak Created: 18/Aug/15  Updated: 18/Aug/15  Resolved: 18/Aug/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: Andreas Nilsson
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
Sprint: Security 8 08/28/15
Participants:

 Description   

Leak of memory or pointers to system resources

Defect 73593 (STATIC_C)
Checker RESOURCE_LEAK (subcategory none)
File: /src/mongo/db/modules/enterprise/src/encryptdb/wiredtiger_encryption_callbacks.cpp
Function mongo_addWiredTigerEncryptors
/src/mongo/db/modules/enterprise/src/encryptdb/wiredtiger_encryption_callbacks.cpp, line: 257
Storage is returned from allocation function "operator new".

        mongo::ExtendedWTEncryptor* extWTEncryptorCBC = new mongo::ExtendedWTEncryptor;

/src/mongo/db/modules/enterprise/src/encryptdb/wiredtiger_encryption_callbacks.cpp, line: 257
Assigning: "extWTEncryptorCBC" = storage returned from "new mongo::<unnamed>::ExtendedWTEncryptor".

        mongo::ExtendedWTEncryptor* extWTEncryptorCBC = new mongo::ExtendedWTEncryptor;

/src/mongo/db/modules/enterprise/src/encryptdb/wiredtiger_encryption_callbacks.cpp, line: 273
Variable "extWTEncryptorCBC" going out of scope leaks the storage it points to.

        return 0;



 Comments   
Comment by Andreas Nilsson [ 18/Aug/15 ]

This is a false positive, the allocated memory gets freed in terminate but Coverity has no way of knowing. I've already set this as a false positive in Coverity but we changed the variable name.

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