[CDRIVER-2267] Resource leak in SRV logic Created: 07/Sep/17  Updated: 28/Oct/23  Resolved: 26/Oct/17

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.9.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Leak of memory or pointers to system resources

Defect 102105 (STATIC_C)
Checker RESOURCE_LEAK (subcategory none)
File: /src/mongoc/mongoc-topology.c
Function mongoc_topology_new
/src/mongoc/mongoc-topology.c, line: 283
Assigning: "hl" = storage returned from "_mongoc_client_get_srv(prefixed_service, &topology->scanner->error)".

          hl = _mongoc_client_get_srv (prefixed_service, &topology->scanner->error);

/src/mongoc/mongoc-topology.c, line: 312
Overwriting "hl" in "hl = hl->next" leaks the storage that "hl" points to.

          hl = hl->next;



 Comments   
Comment by Githook User [ 28/Oct/17 ]

Author:

{'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}

Message: CDRIVER-2267 leak in SRV logic
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/7f0071455cbb94c1927e654330ea38d03a6e210c

Generated at Wed Feb 07 21:14:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.