[Python-checkins] bpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344)

Hai Shi webhook-mailer at python.org
Sat Apr 4 15:24:24 EDT 2020


https://github.com/python/cpython/commit/b709302f3125622986bd458dfb2954fda5e8366d
commit: b709302f3125622986bd458dfb2954fda5e8366d
branch: master
author: Hai Shi <shihai1992 at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-04-04T21:24:16+02:00
summary:

bpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344)

Fix possible refleaks in _json module, memo of PyScannerObject
should be traversed.

files:
A Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst
M Modules/_json.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst
new file mode 100644
index 0000000000000..21ed615917c59
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst	
@@ -0,0 +1 @@
+Fix possible refleaks in :mod:`_json`, memo of PyScannerObject should be traversed.
diff --git a/Modules/_json.c b/Modules/_json.c
index 4682cf84621ee..8117d1601bd3f 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -652,6 +652,7 @@ scanner_traverse(PyScannerObject *self, visitproc visit, void *arg)
     Py_VISIT(self->parse_float);
     Py_VISIT(self->parse_int);
     Py_VISIT(self->parse_constant);
+    Py_VISIT(self->memo);
     return 0;
 }
 



More information about the Python-checkins mailing list