diff options
author | Werner Koch <[email protected]> | 2011-09-20 17:24:52 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2011-09-20 17:24:52 +0000 |
commit | 6cf8890dc1f551a1e87ed8b8e67a733e95b1bb6d (patch) | |
tree | a4485063c34975876ad80d0898af16379d095bc3 /g10/pkclist.c | |
parent | tests: avoid use of freed pointer (diff) | |
download | gnupg-6cf8890dc1f551a1e87ed8b8e67a733e95b1bb6d.tar.gz gnupg-6cf8890dc1f551a1e87ed8b8e67a733e95b1bb6d.zip |
Allow NULL for free_public_key.
Diffstat (limited to 'g10/pkclist.c')
-rw-r--r-- | g10/pkclist.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/g10/pkclist.c b/g10/pkclist.c index 626250ff6..295ee0628 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -1064,8 +1064,7 @@ build_pk_list (ctrl_t ctrl, continue; /* Get and check key for the current name. */ - if (pk) - free_public_key (pk); + free_public_key (pk); pk = xmalloc_clear( sizeof *pk ); pk->req_usage = use; rc = get_pubkey_byname (ctrl, NULL, pk, answer, NULL, NULL, 0, 0 ); @@ -1078,7 +1077,8 @@ build_pk_list (ctrl_t ctrl, /* No validation for a default recipient. */ if (!key_present_in_pk_list(pk_list, pk)) { - free_public_key (pk); pk = NULL; + free_public_key (pk); + pk = NULL; log_info (_("skipped: public key " "already set as default recipient\n") ); } @@ -1108,7 +1108,8 @@ build_pk_list (ctrl_t ctrl, * present in the list */ if (!key_present_in_pk_list(pk_list, pk)) { - free_public_key(pk); pk = NULL; + free_public_key (pk); + pk = NULL; log_info(_("skipped: public key already set\n") ); } else |