diff options
| author | Christian Heimes <christian@cheimes.de> | 2012-09-10 03:08:46 +0200 |
|---|---|---|
| committer | Christian Heimes <christian@cheimes.de> | 2012-09-10 03:08:46 +0200 |
| commit | 8c1bce00d25ddda20d4e760e5771324865ddae17 (patch) | |
| tree | 6f403e0b50cb389c7841b09b303baa2492712baa | |
| parent | 4e80eea60e439d6fb0a12bb803ca52061f29f7d6 (diff) | |
| download | cpython-git-8c1bce00d25ddda20d4e760e5771324865ddae17.tar.gz | |
Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases
| -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 51b59f0310..f0f1d4d07d 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -22,7 +22,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, void *key, int lineno) { PySTEntryObject *ste = NULL; - PyObject *k; + PyObject *k = NULL; k = PyLong_FromVoidPtr(key); if (k == NULL) @@ -75,6 +75,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, return ste; fail: + Py_XDECREF(k); Py_XDECREF(ste); return NULL; } |
