[SERVER-18708] Coverity analysis defect 72713: Resource leak Created: 28/May/15  Updated: 14/Apr/16  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: Daniel Alabi
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 72713 (STATIC_C)
Checker RESOURCE_LEAK (subcategory none)
File: /src/mongo/db/commands/user_management_commands.cpp
Function mongo::<unnamed>::getCurrentUserRoles(mongo::OperationContext *, mongo::AuthorizationManager *, const mongo::UserName &, std::unordered_set<mongo::RoleName, std::hash<mongo::RoleName>, std::equal_to<mongo::RoleName>, std::allocator<mongo::RoleName>> *)
/src/mongo/db/commands/user_management_commands.cpp, line: 151
Variable "user" going out of scope leaks the storage it points to.

            return Status::OK();



 Comments   
Comment by Daniel Alabi [ 28/May/15 ]

This coverity issue appears to be a false positive. The user cache is maintained by the AuthorizationManager, which frees each user when refCount == 0 or upon destruction of the AuthorizationManager.

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