[CDRIVER-921] Coverity analysis defect 72658: Resource leak Created: 08/Oct/15  Updated: 21/Apr/17  Resolved: 14/Oct/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.0-beta0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Hannes Magnusson
Resolution: Done 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 72658 (STATIC_C)
Checker RESOURCE_LEAK (subcategory none)
File: /src/mongoc/mongoc-database.c
Function _mongoc_database_find_collections_legacy
/src/mongoc/mongoc-database.c, line: 708
Assigning: "ctx" = storage returned from "bson_malloc(24UL)".

       ctx = (mongoc_database_find_collections_legacy_ctx_t *)bson_malloc (sizeof (*ctx));

/src/mongoc/mongoc-database.c, line: 754
Variable "ctx" going out of scope leaks the storage it points to.

       return cursor;



 Comments   
Comment by Githook User [ 14/Oct/15 ]

Author:

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

Message: CDRIVER-921: Resource leak
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/70ca4a9e65cddc2815d96386dac5a99d033fc278

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