From 359bd4f61b9e1493081f4f67882554247b53926a Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Tue, 23 Apr 2019 05:56:08 -0600 Subject: [PATCH] bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505) --- .../Core and Builtins/2018-12-08-03-40-43.bpo-18372.DT1nR0.rst | 2 ++ Modules/_pickle.c | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2018-12-08-03-40-43.bpo-18372.DT1nR0.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-12-08-03-40-43.bpo-18372.DT1nR0.rst b/Misc/NEWS.d/next/Core and Builtins/2018-12-08-03-40-43.bpo-18372.DT1nR0.rst new file mode 100644 index 00000000000..d8205b8d32d --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-12-08-03-40-43.bpo-18372.DT1nR0.rst @@ -0,0 +1,2 @@ +Add missing :c:func:`PyObject_GC_Track` calls in the :mod:`pickle` module. +Patch by Zackery Spytz. diff --git a/Modules/_pickle.c b/Modules/_pickle.c index f956a382ac5..391ce5e923c 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -1119,6 +1119,8 @@ _Pickler_New(void) Py_DECREF(self); return NULL; } + + PyObject_GC_Track(self); return self; } @@ -1496,6 +1498,7 @@ _Unpickler_New(void) return NULL; } + PyObject_GC_Track(self); return self; }