Skip to content

Commit 76530cc

Browse files
committed
PYTHON-870 - Fix two unlikely reference leaks.
1 parent e88764d commit 76530cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bson/_cbsonmodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ static int _load_python_objects(PyObject* module) {
385385

386386
if (_load_object(&re_compile, "re", "compile")) {
387387
state->REType = NULL;
388+
Py_DECREF(empty_string);
388389
return 1;
389390
}
390391

@@ -2129,6 +2130,7 @@ static PyObject* get_value(PyObject* self, const char* buffer,
21292130
if (!bson_int64_type)
21302131
goto invalid;
21312132
if (max < 8) {
2133+
Py_DECREF(bson_int64_type);
21322134
goto invalid;
21332135
}
21342136
memcpy(&ll, buffer + *position, 8);

0 commit comments

Comments
 (0)