mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
SF patch 703666: Several objects don't decref tmp on failure in subtype_new
Submitted By: Christopher A. Craig Fillin some missing decrefs.
This commit is contained in:
parent
6891cd3aa3
commit
f466793fcc
4 changed files with 13 additions and 4 deletions
|
@ -751,8 +751,10 @@ float_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
return NULL;
|
||||
assert(PyFloat_CheckExact(tmp));
|
||||
new = type->tp_alloc(type, 0);
|
||||
if (new == NULL)
|
||||
if (new == NULL) {
|
||||
Py_DECREF(tmp);
|
||||
return NULL;
|
||||
}
|
||||
((PyFloatObject *)new)->ob_fval = ((PyFloatObject *)tmp)->ob_fval;
|
||||
Py_DECREF(tmp);
|
||||
return new;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue