Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 692ca9a

Browse files
committed
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.
1 parent 48796c3 commit 692ca9a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Modules/_bsddb.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,9 +1181,7 @@ DB_associate(DBObject* self, PyObject* args, PyObject* kwargs)
11811181
}
11821182

11831183
/* Save a reference to the callback in the secondary DB. */
1184-
if (self->associateCallback != NULL) {
1185-
Py_DECREF(self->associateCallback);
1186-
}
1184+
Py_XDECREF(secondaryDB->associateCallback);
11871185
Py_INCREF(callback);
11881186
secondaryDB->associateCallback = callback;
11891187
secondaryDB->primaryDBType = _DB_get_type(self);
@@ -1217,8 +1215,8 @@ DB_associate(DBObject* self, PyObject* args, PyObject* kwargs)
12171215
MYDB_END_ALLOW_THREADS;
12181216

12191217
if (err) {
1220-
Py_DECREF(self->associateCallback);
1221-
self->associateCallback = NULL;
1218+
Py_XDECREF(secondaryDB->associateCallback);
1219+
secondaryDB->associateCallback = NULL;
12221220
secondaryDB->primaryDBType = 0;
12231221
}
12241222

0 commit comments

Comments
 (0)