From 8aefbded3634aff93af5aa094094ca87c0e64239 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Tue, 19 Nov 2013 18:44:39 -0800 Subject: [PATCH] Don't end an existing transaction if trying to delete a non-existent key The DB4 key deletion routine would always exit the current transaction if the key wasn't found, even if it had been called by another function which had entered the transaction. Only do so if the deletion routine itself is what caused the transaction to be started. --- keydb_db4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keydb_db4.c b/keydb_db4.c index 43f1674..b36ce3f 100644 --- a/keydb_db4.c +++ b/keydb_db4.c @@ -772,7 +772,9 @@ static int db4_delete_key(struct onak_dbctx *dbctx, } if (db4_fetch_key_id(dbctx, keyid, &publickey, true) == 0) { - db4_endtrans(dbctx); + if (!intrans) { + db4_endtrans(dbctx); + } return 1; } -- 2.39.2