diff options
author | Christian Heimes <christian@cheimes.de> | 2012-09-10 01:08:46 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2012-09-10 01:08:46 (GMT) |
commit | 837e53a7c268215bb521a5b0ce765367ca0704da (patch) | |
tree | da5addd9662efa9532e6178fe69a44643cea5dd7 /Python | |
parent | a0e7e41cba6c75f493a64ce09037cecb60642190 (diff) | |
download | cpython-837e53a7c268215bb521a5b0ce765367ca0704da.zip cpython-837e53a7c268215bb521a5b0ce765367ca0704da.tar.gz cpython-837e53a7c268215bb521a5b0ce765367ca0704da.tar.bz2 |
Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases
Diffstat (limited to 'Python')
-rw-r--r-- | Python/symtable.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 1ec51f7..00b3427 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -28,7 +28,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) @@ -83,6 +83,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, return ste; fail: + Py_XDECREF(k); Py_XDECREF(ste); return NULL; } |