[CXX-1299] database::create_collection leaks collection on error Created: 06/Apr/17  Updated: 27/Oct/23  Resolved: 21/Apr/17

Status: Closed
Project: C++ Driver
Component/s: Implementation
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Samuel Rossi (Inactive) Assignee: Samuel Rossi (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

database::create_collection leaks the collection received from libmongoc if an error is thrown. This should be remedied by immediately wrapping the collection_t in a mongocxx::collection before any checks for errors.



 Comments   
Comment by J Rassi [ 21/Apr/17 ]

Changing resolution to "Works as Designed."

Comment by Samuel Rossi (Inactive) [ 14/Apr/17 ]

There isn't actually a leak in the code; the function only throws if the collection returned is null, which means there isn't anything to leak.

Generated at Wed Feb 07 22:02:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.