diff options
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/_bsddb.c | 8 |
2 files changed, 6 insertions, 5 deletions
@@ -38,6 +38,9 @@ Core and builtins Extension Modules ----------------- +- Bug #1215432: in bsddb DB.associate() would crash when a DBError + was supposed to be raised. + - Fix 64-bit problems in bsddb. - Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index a834cba..ab10e76 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -1174,9 +1174,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); @@ -1210,8 +1208,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; } |