fix potential refleak in PyFloat_AsDouble (closes #23590)

This commit is contained in:
Benjamin Peterson 2015-03-06 09:08:44 -05:00
parent b5a23223f0
commit a915723dc7
2 changed files with 7 additions and 0 deletions

View file

@ -220,6 +220,7 @@ PyFloat_AsDouble(PyObject *op)
if (fo == NULL)
return -1;
if (!PyFloat_Check(fo)) {
Py_DECREF(fo);
PyErr_SetString(PyExc_TypeError,
"nb_float should return float object");
return -1;