]> git.sommitrealweird.co.uk Git - onak.git/blobdiff - merge.c
cscvs to tla changeset 42
[onak.git] / merge.c
diff --git a/merge.c b/merge.c
index 69543378e283f78fef4af9ee898eda2c57c32695..cfe2d97d1c2711bfbb74d79eeba4b2d37f498c0f 100644 (file)
--- 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;
                                } else {
                                        prev->next = curkey->next;
                                        prev = curkey->next;
+                                       curkey->next = NULL;
+                                       free_publickey(curkey);
                                }
                        } else {
                                prev = curkey;
                                if (verbose) {
                                }
                        } 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);
                        }
                                }
                                store_key(oldkey, intrans, true);
                        }
@@ -407,7 +410,8 @@ int update_keys(struct openpgp_publickey **keys, bool verbose)
                        oldkey = NULL;
                } else {
                        if (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++;
                        }
                        store_key(curkey, intrans, false);
                        newkeys++;