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:
Raymond Hettinger 2003-06-28 20:04:25 +00:00
parent 6891cd3aa3
commit f466793fcc
4 changed files with 13 additions and 4 deletions

View file

@ -958,8 +958,10 @@ int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
new = type->tp_alloc(type, 0);
if (new == NULL)
if (new == NULL) {
Py_DECREF(tmp);
return NULL;
}
((PyIntObject *)new)->ob_ival = ival;
Py_DECREF(tmp);
return new;