]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344)
authorHai Shi <shihai1992@gmail.com>
Sat, 4 Apr 2020 19:24:16 +0000 (03:24 +0800)
committerGitHub <noreply@github.com>
Sat, 4 Apr 2020 19:24:16 +0000 (21:24 +0200)
Fix possible refleaks in _json module, memo of PyScannerObject
should be traversed.

Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst [new file with mode: 0644]
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 (file)
index 0000000..21ed615
--- /dev/null
@@ -0,0 +1 @@
+Fix possible refleaks in :mod:`_json`, memo of PyScannerObject should be traversed.
index 4682cf84621ee9b5f92119bd5ff756c96a7047d6..8117d1601bd3f86079950af2c97ab7f0c9e5a77b 100644 (file)
@@ -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;
 }