mirror of
https://github.com/python/cpython.git
synced 2025-01-12 11:34:54 +08:00
Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases
This commit is contained in:
commit
310f81449a
@ -24,7 +24,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
|
||||
void *key, int lineno, int col_offset)
|
||||
{
|
||||
PySTEntryObject *ste = NULL;
|
||||
PyObject *k;
|
||||
PyObject *k = NULL;
|
||||
|
||||
k = PyLong_FromVoidPtr(key);
|
||||
if (k == NULL)
|
||||
@ -79,6 +79,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
|
||||
|
||||
return ste;
|
||||
fail:
|
||||
Py_XDECREF(k);
|
||||
Py_XDECREF(ste);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user