[CDRIVER-2135] Coverity analysis defect 76459: Resource leak Created: 21/Apr/17  Updated: 28/Oct/23  Resolved: 24/Apr/17

Status: Closed
Project: C Driver
Component/s: libbson
Affects Version/s: None
Fix Version/s: 1.7.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Hannes Magnusson
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 76459 (STATIC_C)
Checker RESOURCE_LEAK (subcategory none)
File: /examples/bson-streaming-reader.c
Function bson_streaming_remote_open
/examples/bson-streaming-reader.c, line: 66
"getaddrinfo" allocates memory that is stored into "server_list".
/examples/bson-streaming-reader.c, line: 83
Assigning: "ptr" = "server_list".
/examples/bson-streaming-reader.c, line: 106
Variable "server_list" going out of scope leaks the storage it points to.



 Comments   
Comment by Githook User [ 24/Apr/17 ]

Author:

{'name': 'Hannes Magnusson', 'username': 'bjori', 'email': 'bjori@php.net'}

Message: CDRIVER-2135 Resource leak on failure in example
Branch: master
https://github.com/mongodb/libbson/commit/80e34b4ba9f2dc029948873b1273c9b62d080aee

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