From 837e53a7c268215bb521a5b0ce765367ca0704da Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 10 Sep 2012 03:08:46 +0200 Subject: [PATCH] Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases --- Python/symtable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Python/symtable.c b/Python/symtable.c index 1ec51f708c3..00b342761f0 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; }