summaryrefslogtreecommitdiffstats
path: root/Modules/_bsddb.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2007-10-06 07:48:10 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2007-10-06 07:48:10 (GMT)
commite70be5cbb936c6b9e3b54f9a5ff3570f52f59bab (patch)
treeeb95d752bb04510eeb6b979d197d228fc52da792 /Modules/_bsddb.c
parent556b43d936e83d15a062c668be19de739d587f90 (diff)
downloadcpython-e70be5cbb936c6b9e3b54f9a5ff3570f52f59bab.zip
cpython-e70be5cbb936c6b9e3b54f9a5ff3570f52f59bab.tar.gz
cpython-e70be5cbb936c6b9e3b54f9a5ff3570f52f59bab.tar.bz2
Stab in the dark attempt to fix the test_bsddb3 failure on sparc and S-390
ubuntu buildbots.
Diffstat (limited to 'Modules/_bsddb.c')
-rw-r--r--Modules/_bsddb.c8
1 files changed, 7 insertions, 1 deletions
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*