*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++;