From: Gregory P. Smith Date: Sat, 6 Oct 2007 07:48:10 +0000 (+0000) Subject: Stab in the dark attempt to fix the test_bsddb3 failure on sparc and S-390 X-Git-Tag: v2.6a1~1222 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e70be5cbb936c6b9e3b54f9a5ff3570f52f59bab;p=python Stab in the dark attempt to fix the test_bsddb3 failure on sparc and S-390 ubuntu buildbots. --- diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index e5df97fe58..1c57f07b90 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*