You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CXX-813 Fix memory errors exposed by ASAN and Valgrind
- We can't assume that libmongoc has automatically called init/cleanup
for us. It only does that on some platforms. That makes it mandatory
to have an instance object. Many of our tests didn't do that, and it
would be painful for users. Set things up so that an instance is
implicitly created as needed, and provide ways to retrieve the
instance. This required moving the tests for instance to its own
process, among other nuisances.
- The collection::create_index method was not cleaning up the keys that
had been allocated by libbson. Add the needed bson_free call.
- The collection::distinct method was not cleaning up the temorary
database object that it constructs. Add the needed database_destroy
call.
- Fix some mocks so that they write to the bson_error_t out parameter
when returning a non-successful code, as otherwise these lead to
read-from-uninit errors when we promote the uninitialized bson_error_t
to an exception.
0 commit comments