diff options
author | Georg Brandl <georg@python.org> | 2012-09-29 09:27:15 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-09-29 09:27:15 +0200 |
commit | 99a247fd01c1cd780c0c3ee1116657627f1ee744 (patch) | |
tree | 319e33cb6612c3fafb2eb82e15c5e85e3d771e4f /Python/symtable.c | |
parent | 1628eaa5dc8892ff381ca7558cc7c8d80fac494d (diff) | |
parent | 8ed677db129171317b8ee7cd45b39b9013f5a2d6 (diff) | |
download | cpython-git-99a247fd01c1cd780c0c3ee1116657627f1ee744.tar.gz |
Merge with main repo default branch.
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index a0b786b3d7..1c291bbac0 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -24,16 +24,18 @@ 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) 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->ste_id = k; /* ste owns reference to k */ ste->ste_name = name; Py_INCREF(name); |