During the C driver implementation (CDRIVER-2875), some potential leaks were discovered when using libmongocrypt against libbson built with the BSON_MEMCHECK flag.
This flag makes it so any usage of a bson_t heap allocates (whereas normally, heap allocation only occurs when the data exceeds the stack allocated size). So this caught a couple instances of where we would leak if the document being used was too large.