From: Victor Stinner Date: Thu, 11 Jul 2013 22:08:59 +0000 (+0200) Subject: Issue #18408: Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroy X-Git-Tag: v3.4.0a1~243 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c31df042340ed97b38d6364d4ee5a8d74aafca01;p=python Issue #18408: Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroy the newly created pickler, and not PyObject_GC_Del(). --- diff --git a/Modules/_pickle.c b/Modules/_pickle.c index adb642e2f6..8b3438e4e3 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -782,7 +782,7 @@ _Pickler_New(void) self->max_output_len); if (self->memo == NULL || self->output_buffer == NULL) { - PyObject_GC_Del(self); + Py_DECREF(self); return NULL; } return self;