diff options
Diffstat (limited to 'tools/card-tool-keys.c')
-rw-r--r-- | tools/card-tool-keys.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/card-tool-keys.c b/tools/card-tool-keys.c index e9edf9818..4e057ad94 100644 --- a/tools/card-tool-keys.c +++ b/tools/card-tool-keys.c @@ -214,9 +214,12 @@ get_matching_keys (const unsigned char *keygrip, int protocol, err = get_matching_keys (keygrip, GNUPG_PROTOCOL_OPENPGP, &kb); if (!err || gpg_err_code (err) == GPG_ERR_NO_PUBKEY) { - *keyblock_tail = kb; - keyblock_tail = &kb->next; - kb = NULL; + if (!err) + { + *keyblock_tail = kb; + keyblock_tail = &kb->next; + kb = NULL; + } err = get_matching_keys (keygrip, GNUPG_PROTOCOL_CMS, &kb); if (!err) { |