PYTHON-1554 Fix datetime decoding memory leak

This commit is contained in:
Shane Harvey 2018-05-11 13:30:11 -07:00
parent cac0d5548f
commit 5ff33a2a37

View File

@ -2120,6 +2120,7 @@ static PyObject* get_value(PyObject* self, PyObject* name, const char* buffer,
/* convert to local time */
if (options->tzinfo != Py_None) {
astimezone = PyObject_GetAttrString(value, "astimezone");
Py_DECREF(value);
if (!astimezone) {
Py_DECREF(replace);
Py_DECREF(args);