Add missing initialisation of DB4 cursor for skshash when deleting key
[onak.git] / keydb_db4.c
index 04d727c6eb8df6df3778f98c67b070686243491e..065fb5b690364099d3f06c90e6a41a4c1742cf62 100644 (file)
@@ -309,7 +309,7 @@ static void db4_initdb(bool readonly)
        FILE      *numdb = NULL;
        int        ret = 0;
        int        i = 0;
-       u_int32_t  flags = 0;
+       uint32_t   flags = 0;
        struct stat statbuf;
        int        maxlocks;
 
@@ -1013,6 +1013,10 @@ static int db4_delete_key(uint64_t keyid, bool intrans)
        }
 
        if (!deadlock) {
+               ret = skshashdb->cursor(skshashdb,
+                       txn,
+                       &cursor,
+                       0);   /* flags */
                get_skshash(publickey, &hash);
 
                memset(&key, 0, sizeof(key));