Skip to content

Commit 48aa605

Browse files
committed
Issue #27942: Fix memory leak in codeobject.c
1 parent a876027 commit 48aa605

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Objects/codeobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ intern_string_constants(PyObject *tuple)
6565
intern_string_constants(v);
6666
}
6767
else if (PyFrozenSet_CheckExact(v)) {
68+
PyObject *w = v;
6869
PyObject *tmp = PySequence_Tuple(v);
6970
if (tmp == NULL) {
7071
PyErr_Clear();
@@ -77,6 +78,7 @@ intern_string_constants(PyObject *tuple)
7778
}
7879
else {
7980
PyTuple_SET_ITEM(tuple, i, v);
81+
Py_DECREF(w);
8082
modified = 1;
8183
}
8284
}

0 commit comments

Comments
 (0)