mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases
This commit is contained in:
parent
a0e7e41cba
commit
837e53a7c2
1 changed files with 2 additions and 1 deletions
|
@ -28,7 +28,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
|
||||||
void *key, int lineno, int col_offset)
|
void *key, int lineno, int col_offset)
|
||||||
{
|
{
|
||||||
PySTEntryObject *ste = NULL;
|
PySTEntryObject *ste = NULL;
|
||||||
PyObject *k;
|
PyObject *k = NULL;
|
||||||
|
|
||||||
k = PyLong_FromVoidPtr(key);
|
k = PyLong_FromVoidPtr(key);
|
||||||
if (k == NULL)
|
if (k == NULL)
|
||||||
|
@ -83,6 +83,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
|
||||||
|
|
||||||
return ste;
|
return ste;
|
||||||
fail:
|
fail:
|
||||||
|
Py_XDECREF(k);
|
||||||
Py_XDECREF(ste);
|
Py_XDECREF(ste);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue