Skip to content

Commit 2e6aa7a

Browse files
authored
PYTHON-5179 Fix memory leak in bson_str_to_json (#64)
* PYTHON-5179 Fix memory leak in bson_str_to_json * update changelog * address review
1 parent b620a77 commit 2e6aa7a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Changelog
33

44
0.6.0 (unreleased)
55
``````````````````
6-
Drop support for Python 3.8.
6+
- Drop support for Python 3.8.
7+
- Fix memory leak in ``dump`` and ``dumps`` when an invalid ``mode`` is provided.
78

89
0.5.0
910
`````

bsonjs/bsonjs.c

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ int mode)
5050
PyErr_SetString(PyExc_ValueError, "The value of mode must be one of: "
5151
"bsonjs.RELAXED, bsonjs.LEGACY, "
5252
"or bsonjs.CANONICAL.");
53+
bson_reader_destroy(reader);
5354
return NULL;
5455
}
5556

0 commit comments

Comments
 (0)