]> granicus.if.org Git - python/commitdiff
Stab in the dark attempt to fix the test_bsddb3 failure on sparc and S-390
authorGregory P. Smith <greg@mad-scientist.com>
Sat, 6 Oct 2007 07:48:10 +0000 (07:48 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Sat, 6 Oct 2007 07:48:10 +0000 (07:48 +0000)
ubuntu buildbots.

Modules/_bsddb.c

index e5df97fe58d3f0a2dd3a7bd46760c1c0350f20ac..1c57f07b901f4b20c415c162965c8e29d75185a6 100644 (file)
@@ -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*