33 lines
996 B
Diff
33 lines
996 B
Diff
|
diff -Nru db-4.5.20.orig/sequence/sequence.c db-4.5.20/sequence/sequence.c
|
||
|
--- db-4.5.20.orig/sequence/sequence.c 2006-11-18 10:37:11.000000000 +0100
|
||
|
+++ db-4.5.20/sequence/sequence.c 2006-11-18 10:44:31.000000000 +0100
|
||
|
@@ -228,6 +228,9 @@
|
||
|
seq->seq_data.ulen = seq->seq_data.size = sizeof(seq->seq_record);
|
||
|
seq->seq_rp = &seq->seq_record;
|
||
|
|
||
|
+ if ((ret = __dbt_usercopy(dbenv, keyp)) != 0)
|
||
|
+ goto err;
|
||
|
+
|
||
|
memset(&seq->seq_key, 0, sizeof(DBT));
|
||
|
if ((ret = __os_malloc(dbenv, keyp->size, &seq->seq_key.data)) != 0)
|
||
|
goto err;
|
||
|
@@ -365,6 +368,7 @@
|
||
|
ret = t_ret;
|
||
|
|
||
|
ENV_LEAVE(dbenv, ip);
|
||
|
+ __dbt_userfree(dbenv, keyp, NULL, NULL);
|
||
|
return (ret);
|
||
|
}
|
||
|
|
||
|
@@ -765,6 +769,10 @@
|
||
|
{
|
||
|
SEQ_ILLEGAL_BEFORE_OPEN(seq, "DB_SEQUENCE->get_key");
|
||
|
|
||
|
+ if (F_ISSET(key, DB_DBT_USERCOPY))
|
||
|
+ return (__db_retcopy(seq->seq_dbp->dbenv, key,
|
||
|
+ seq->seq_key.data, seq->seq_key.size, NULL, 0));
|
||
|
+
|
||
|
key->data = seq->seq_key.data;
|
||
|
key->size = key->ulen = seq->seq_key.size;
|
||
|
key->flags = seq->seq_key.flags;
|