We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d2aef5 commit 9e780ccCopy full SHA for 9e780cc
1 file changed
Modules/_bsddb.c
@@ -5024,14 +5024,20 @@ DBSequence_get_key(DBSequenceObject* self, PyObject* args)
5024
{
5025
int err;
5026
DBT key;
5027
+ PyObject *retval;
5028
+ key.flags = DB_DBT_MALLOC;
5029
CHECK_SEQUENCE_NOT_CLOSED(self)
5030
MYDB_BEGIN_ALLOW_THREADS
5031
err = self->sequence->get_key(self->sequence, &key);
5032
MYDB_END_ALLOW_THREADS
5033
5034
+ if (!err)
5035
+ retval = PyBytes_FromStringAndSize(key.data, key.size);
5036
+
5037
+ free_dbt(&key);
5038
RETURN_IF_ERR();
5039
- return PyBytes_FromStringAndSize(key.data, key.size);
5040
+ return retval;
5041
}
5042
5043
static PyObject*
0 commit comments