diff options
author | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2000-10-04 16:22:26 (GMT) |
---|---|---|
committer | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2000-10-04 16:22:26 (GMT) |
commit | 5196c586bbcde40538868f8aa3a1f54af1027e33 (patch) | |
tree | 6e6117da135d33bd221f0c1a101267e941c6fdae /Modules | |
parent | e3550a65eb0380b6026947d5ad8f4db272d99e55 (diff) | |
download | cpython-5196c586bbcde40538868f8aa3a1f54af1027e33.zip cpython-5196c586bbcde40538868f8aa3a1f54af1027e33.tar.gz cpython-5196c586bbcde40538868f8aa3a1f54af1027e33.tar.bz2 |
- Fix a GC bug caused by PyDict_New() failing.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/cPickle.c | 3 |
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); |