From e70be5cbb936c6b9e3b54f9a5ff3570f52f59bab Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sat, 6 Oct 2007 07:48:10 +0000 Subject: Stab in the dark attempt to fix the test_bsddb3 failure on sparc and S-390 ubuntu buildbots. --- Modules/_bsddb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index e5df97f..1c57f07 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -4903,14 +4903,20 @@ DBSequence_get_key(DBSequenceObject* self, PyObject* args) { int err; DBT key; + PyObject *retval; + key.flags = DB_DBT_MALLOC; CHECK_SEQUENCE_NOT_CLOSED(self) MYDB_BEGIN_ALLOW_THREADS err = self->sequence->get_key(self->sequence, &key); MYDB_END_ALLOW_THREADS + if (!err) + retval = PyString_FromStringAndSize(key.data, key.size); + + FREE_DBT(key); RETURN_IF_ERR(); - return PyString_FromStringAndSize(key.data, key.size); + return retval; } static PyObject* -- cgit v0.12