summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS2
-rw-r--r--Objects/codeobject.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index d787a29..6b77ffe 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -588,6 +588,8 @@ Core and Builtins
- Issue #28008: Implement PEP 530 -- asynchronous comprehensions.
+- Issue #27942: Fix memory leak in codeobject.c
+
Library
-------
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index b6e5bd3..f7f91a8 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -77,6 +77,7 @@ intern_string_constants(PyObject *tuple)
intern_string_constants(v);
}
else if (PyFrozenSet_CheckExact(v)) {
+ PyObject *w = v;
PyObject *tmp = PySequence_Tuple(v);
if (tmp == NULL) {
PyErr_Clear();
@@ -89,6 +90,7 @@ intern_string_constants(PyObject *tuple)
}
else {
PyTuple_SET_ITEM(tuple, i, v);
+ Py_DECREF(w);
modified = 1;
}
}