Mercurial > cpython-lru_cache-weakref
diff Python/symtable.c @ 78944:61446e56f683 2.7
Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Mon, 10 Sep 2012 03:08:46 +0200 |
| parents | b36cb4602e21 |
| children | f19b84915c17 |
line wrap: on
line diff
--- a/Python/symtable.c Mon Sep 10 03:00:14 2012 +0200 +++ b/Python/symtable.c Mon Sep 10 03:08:46 2012 +0200 @@ -22,7 +22,7 @@ void *key, int lineno) { PySTEntryObject *ste = NULL; - PyObject *k; + PyObject *k = NULL; k = PyLong_FromVoidPtr(key); if (k == NULL) @@ -75,6 +75,7 @@ return ste; fail: + Py_XDECREF(k); Py_XDECREF(ste); return NULL; }
