diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2005-06-06 09:55:06 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2005-06-06 09:55:06 (GMT) |
commit | 692ca9a0cbd32141fdc674ec2707b5893a8503b7 (patch) | |
tree | efffdadba6afe3de1a0ac6c26c3b579fd2523298 /Modules/_bsddb.c | |
parent | 48796c32417750810d9aea2e0cf5695146821f6f (diff) | |
download | cpython-692ca9a0cbd32141fdc674ec2707b5893a8503b7.zip cpython-692ca9a0cbd32141fdc674ec2707b5893a8503b7.tar.gz cpython-692ca9a0cbd32141fdc674ec2707b5893a8503b7.tar.bz2 |
fixes pybsddb SF bug id 1215432. DB.associate() would crash when a
DBError was supposed to be raised.
needs backport to 2.4.x and possibly 2.3.x.
Diffstat (limited to 'Modules/_bsddb.c')
-rw-r--r-- | Modules/_bsddb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index 3858e26..12bb768 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -1181,9 +1181,7 @@ DB_associate(DBObject* self, PyObject* args, PyObject* kwargs) } /* Save a reference to the callback in the secondary DB. */ - if (self->associateCallback != NULL) { - Py_DECREF(self->associateCallback); - } + Py_XDECREF(secondaryDB->associateCallback); Py_INCREF(callback); secondaryDB->associateCallback = callback; secondaryDB->primaryDBType = _DB_get_type(self); @@ -1217,8 +1215,8 @@ DB_associate(DBObject* self, PyObject* args, PyObject* kwargs) MYDB_END_ALLOW_THREADS; if (err) { - Py_DECREF(self->associateCallback); - self->associateCallback = NULL; + Py_XDECREF(secondaryDB->associateCallback); + secondaryDB->associateCallback = NULL; secondaryDB->primaryDBType = 0; } |