Skip to content

Commit 28b4048

Browse files
committed
missing bson_destroy
1 parent c8a2d94 commit 28b4048

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/libmongoc/src/mongoc/mongoc-buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#endif
3232

3333

34-
static inline void
34+
static void
3535
make_space_for (mongoc_buffer_t *buffer, size_t data_size)
3636
{
3737
if (buffer->len + data_size > buffer->datalen) {

src/libmongoc/tests/test-mongoc-bulk.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5094,10 +5094,8 @@ test_bulk_write_more_than_INT_MAX (void)
50945094
// Subtract 32 for overhead.
50955095
size_t large_sz = 16777216 - 32;
50965096
char *large_str = bson_malloc (large_sz);
5097-
for (size_t i = 0; i < large_sz; i++) {
5098-
large_str[i] = 'A';
5099-
}
5100-
large_str[large_sz] = '\0';
5097+
memset (large_str, 'A', large_sz - 1);
5098+
large_str[large_sz - 1] = '\0';
51015099
BSON_ASSERT (
51025100
bson_append_utf8 (&large_doc, "key", 3, large_str, large_sz));
51035101
bson_free (large_str);
@@ -5118,6 +5116,8 @@ test_bulk_write_more_than_INT_MAX (void)
51185116

51195117
ok = (bool) mongoc_bulk_operation_execute (bulk, NULL /* reply */, &error);
51205118
ASSERT_OR_PRINT (ok, error);
5119+
5120+
bson_destroy (&large_doc);
51215121
mongoc_bulk_operation_destroy (bulk);
51225122
mongoc_collection_destroy (coll);
51235123
mongoc_client_destroy (client);

0 commit comments

Comments
 (0)