PYTHON-969 - Check return value from PyObject_Call before using it in PyObject_GetAttrString.

This commit is contained in:
Luke Lovett 2015-07-22 16:35:17 -07:00
parent 07ff7ea721
commit f62dbc15bd

View File

@ -1912,6 +1912,12 @@ static PyObject* get_value(PyObject* self, const char* buffer,
}
Py_XDECREF(utc_type);
value = PyObject_Call(replace, args, kwargs);
if (!value) {
Py_DECREF(replace);
Py_DECREF(args);
Py_DECREF(kwargs);
goto invalid;
}
/* convert to local time */
if (options->tzinfo != Py_None) {