Commit 8c1bce00 authored by Christian Heimes's avatar Christian Heimes

Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases

parent 4e80eea6
...@@ -22,7 +22,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, ...@@ -22,7 +22,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
void *key, int lineno) void *key, int lineno)
{ {
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)
...@@ -75,6 +75,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, ...@@ -75,6 +75,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;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment