From: Neil Schemenauer Date: Wed, 4 Oct 2000 16:22:26 +0000 (+0000) Subject: - Fix a GC bug caused by PyDict_New() failing. X-Git-Tag: v2.0c1~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5196c586bbcde40538868f8aa3a1f54af1027e33;p=python - Fix a GC bug caused by PyDict_New() failing. --- diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 2466465b5f..5b02c2aa7d 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -2875,7 +2875,8 @@ Instance_New(PyObject *cls, PyObject *args) { inst->in_class=(PyClassObject*)cls; Py_INCREF(cls); UNLESS (inst->in_dict=PyDict_New()) { - Py_DECREF(inst); + inst = (PyInstanceObject *) PyObject_AS_GC(inst); + PyObject_DEL(inst); goto err; } PyObject_GC_Init(inst);