Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff9fe23

Browse files
author
Stefan Krah
committed
Fix refleak.
2 parents 3e1770f + c0cbed1 commit ff9fe23

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Python/compile.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,8 +1146,10 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
11461146

11471147
v = PyDict_GetItem(dict, t);
11481148
if (!v) {
1149-
if (PyErr_Occurred())
1149+
if (PyErr_Occurred()) {
1150+
Py_DECREF(t);
11501151
return -1;
1152+
}
11511153
arg = PyDict_Size(dict);
11521154
v = PyLong_FromSsize_t(arg);
11531155
if (!v) {

0 commit comments

Comments
 (0)