From 3bee120e15c2a800c9908cbdc6313b082ac8593c Mon Sep 17 00:00:00 2001 From: David Shaw Date: Mon, 22 May 2006 21:38:13 +0000 Subject: [PATCH] * import.c (import_one): Fix bug when importing a new key from a file. --- g10/ChangeLog | 3 +++ g10/import.c | 12 +++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 79eed36b5..97eaa5e63 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,8 @@ 2006-05-22 David Shaw + * 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 diff --git a/g10/import.c b/g10/import.c index 81aa506a4..97d4b8f39 100644 --- a/g10/import.c +++ b/g10/import.c @@ -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);