#include <stdio.h>
#include <stdlib.h>
+#include "decodekey.h"
#include "keydb.h"
#include "keyid.h"
-#include "keyindex.h"
#include "keystructs.h"
#include "ll.h"
#include "mem.h"
*keys = curkey->next;
} else {
prev->next = curkey->next;
- prev = curkey->next;
+ curkey->next = NULL;
+ free_publickey(curkey);
+ curkey = prev;
}
} else {
prev = curkey;
if (verbose) {
- fprintf(stderr, "Merged key; storing updated key.\n");
+ fprintf(stderr,
+ "Merged key; storing updated key.\n");
}
store_key(oldkey, intrans, true);
}
oldkey = NULL;
} else {
if (verbose) {
- fprintf(stderr, "Storing completely new key.\n");
+ fprintf(stderr,
+ "Storing completely new key.\n");
}
store_key(curkey, intrans, false);
newkeys++;