summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>2000-10-04 16:22:26 (GMT)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>2000-10-04 16:22:26 (GMT)
commit5196c586bbcde40538868f8aa3a1f54af1027e33 (patch)
tree6e6117da135d33bd221f0c1a101267e941c6fdae
parente3550a65eb0380b6026947d5ad8f4db272d99e55 (diff)
downloadcpython-5196c586bbcde40538868f8aa3a1f54af1027e33.zip
cpython-5196c586bbcde40538868f8aa3a1f54af1027e33.tar.gz
cpython-5196c586bbcde40538868f8aa3a1f54af1027e33.tar.bz2
- Fix a GC bug caused by PyDict_New() failing.
-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);