diff --git a/Modules/_pickle.c b/Modules/_pickle.c index adb642e2f62..8b3438e4e37 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;