diff options
author | Christian Heimes <christian@cheimes.de> | 2012-09-12 17:58:20 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2012-09-12 17:58:20 +0200 |
commit | 950b159a3a44c7cd322465349ddcd7567042d265 (patch) | |
tree | 1333c9aba065377232b67508555b2a42c3b3cada /Python/symtable.c | |
parent | b3d4e81305da73a5eb48d093eed469d31bac7f17 (diff) | |
parent | d5b804cccce865c5bde533ce79b32c6509a2a7b5 (diff) | |
download | cpython-950b159a3a44c7cd322465349ddcd7567042d265.tar.gz |
Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases.
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 36f59ae51e..1c291bbac0 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -30,8 +30,10 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block, if (k == NULL) goto fail; ste = PyObject_New(PySTEntryObject, &PySTEntry_Type); - if (ste == NULL) + if (ste == NULL) { + Py_DECREF(k); goto fail; + } ste->ste_table = st; ste->ste_id = k; /* ste owns reference to k */ |