summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bson/bson.c2
-rw-r--r--src/ejdb/tests/ejdbtest2.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bson/bson.c b/src/bson/bson.c
index 1fa3c77..ac6a626 100644
--- a/src/bson/bson.c
+++ b/src/bson/bson.c
@@ -1823,6 +1823,7 @@ static void _bson_fix_duplicate_keys(bson_iterator *it, bson *bso) {
BSON_ITERATOR_INIT(&it2, &bst);
_bson_fix_duplicate_keys(&it2, bso);
bson_append_finish_object(bso);
+ bson_destroy(&bst);
} else if (bt2 == BSON_ARRAY) {
char ibuf[TCNUMBUFSIZ];
memset(ibuf, '\0', TCNUMBUFSIZ);
@@ -1860,7 +1861,6 @@ static void _bson_fix_duplicate_keys(bson_iterator *it, bson *bso) {
} else {
bson_append_field_from_iterator(&it2, bso);
}
- tclistclear(dups);
tclistdel(dups);
}
tcmapdel(keys);
diff --git a/src/ejdb/tests/ejdbtest2.c b/src/ejdb/tests/ejdbtest2.c
index 51e0c14..bbba0a6 100644
--- a/src/ejdb/tests/ejdbtest2.c
+++ b/src/ejdb/tests/ejdbtest2.c
@@ -6101,6 +6101,9 @@ void testTicket148(void) {
bt = bson_find_fieldpath_value("info.name.mot.age", &it);
CU_ASSERT_TRUE(BSON_IS_NUM_TYPE(bt));
CU_ASSERT_EQUAL(bson_iterator_int(&it), 35);
+
+ ejdbquerydel(q1);
+ tclistdel(q1res);
}