-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.0.2
-
Component/s: None
-
None
when I call mongoc_database_get_collection_info() a new bson is created:
https://github.com/mongodb/mongo-c-driver/blob/048c851919dc32c98b5f8a9a0270e69af9385db3/src/mongoc/mongoc-database.c#L741
the bson correct. But, this bson is sent to mongoc_database_command_simple() and then to mongoc_client_command_simple()
The issue is this bson is sent to bson_init() :
https://github.com/mongodb/mongo-c-driver/blob/048c851919dc32c98b5f8a9a0270e69af9385db3/src/mongoc/mongoc-client.c#L1247
so the flags of this bson changes from BSON_FLAG_INLINE to BSON_FLAG_INLINE | BSON_FLAG_STATIC
So later when bson_destroy() is called, the buffer is not freed()
I think bson_reinit() should be called instead. But I'm not sure. I'm not even sure if we need to call something on this bson.