mirror of https://github.com/python/cpython
Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases.
This commit is contained in:
parent
1526582df6
commit
55ad6515c9
|
@ -34,8 +34,10 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
|
|||
if (k == NULL)
|
||||
goto fail;
|
||||
ste = PyObject_New(PySTEntryObject, &PySTEntry_Type);
|
||||
if (ste == NULL)
|
||||
if (ste == NULL) {
|
||||
Py_DECREF(k);
|
||||
goto fail;
|
||||
}
|
||||
ste->ste_table = st;
|
||||
ste->ste_id = k; /* ste owns reference to k */
|
||||
|
||||
|
|
Loading…
Reference in New Issue