Skip to content

Commit 5ff33a2

Browse files
committed
PYTHON-1554 Fix datetime decoding memory leak
1 parent cac0d55 commit 5ff33a2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bson/_cbsonmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,6 +2120,7 @@ static PyObject* get_value(PyObject* self, PyObject* name, const char* buffer,
21202120
/* convert to local time */
21212121
if (options->tzinfo != Py_None) {
21222122
astimezone = PyObject_GetAttrString(value, "astimezone");
2123+
Py_DECREF(value);
21232124
if (!astimezone) {
21242125
Py_DECREF(replace);
21252126
Py_DECREF(args);

0 commit comments

Comments
 (0)