* import.c (import_one): Fix bug when importing a new key from a file.
authorDavid Shaw <dshaw@jabberwocky.com>
Mon, 22 May 2006 21:38:13 +0000 (21:38 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Mon, 22 May 2006 21:38:13 +0000 (21:38 +0000)
g10/ChangeLog
g10/import.c

index 79eed36..97eaa5e 100644 (file)
@@ -1,5 +1,8 @@
 2006-05-22  David Shaw  <dshaw@jabberwocky.com>
 
+       * import.c (import_one): Fix bug when importing a new key from a
+       file.
+
        * getkey.c (get_pubkey_byname), import.c (import_one): Fix key
        selection problem when auto-key-locate returns a list of keys, not
        all of which are usable (revoked, expired, etc).  Noted by Simon
index 81aa506..97d4b8f 100644 (file)
@@ -978,15 +978,13 @@ import_one( const char *fname, KBNODE keyblock, struct stats_s *stats,
       }
     else if(new_key)
       {
-       if(fpr && stats->imported==1)
+       if(fpr)
          {
            xfree(*fpr);
-           *fpr=fingerprint_from_pk(pk,NULL,fpr_len);
-         }
-       else
-         {
-           xfree(*fpr);
-           *fpr=NULL;
+           if(stats->imported==1)
+             *fpr=fingerprint_from_pk(pk,NULL,fpr_len);
+           else
+             *fpr=NULL;
          }
 
        revocation_present(keyblock);