X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/d2b297e2cf5769ecf4cf22a26f8c9775415c2999..556f51f104fbbb5bd0d51b61a18d7e5af2759079:/merge.c?ds=sidebyside diff --git a/merge.c b/merge.c index 6954337..cfe2d97 100644 --- a/merge.c +++ b/merge.c @@ -395,11 +395,14 @@ int update_keys(struct openpgp_publickey **keys, bool verbose) } else { prev->next = curkey->next; prev = curkey->next; + curkey->next = NULL; + free_publickey(curkey); } } 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); } @@ -407,7 +410,8 @@ int update_keys(struct openpgp_publickey **keys, bool verbose) 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++;