summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/cPickle.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index 2466465..5b02c2a 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);