Skip to content

Commit

Permalink
card-openpgp.c - fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
dengert committed Dec 14, 2024
1 parent 07c1cae commit 0fe4e48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libopensc/card-openpgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2915,11 +2915,12 @@ pgp_update_pubkey_blob(sc_card_t *card, sc_cardctl_openpgp_key_gen_store_info_t
LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS);

r = sc_pkcs15_encode_pubkey_as_spki(card->ctx, &p15pubkey, &data, &len);
/* key_info is missing from algo_id, which get allocated in
/*
* key_info is missing from algo_id, which get allocated in
* sc_pkcs15_encode_pubkey_as_spki, so free it here.
*/
free(p15pubkey->alg_id);
p15pubkey->alg_id = NULL;
free(p15pubkey.alg_id);
p15pubkey.alg_id = NULL;
LOG_TEST_RET(card->ctx, r, "Cannot encode pubkey");

sc_log(card->ctx, "Updating blob %04X's content.", blob_id);
Expand Down

0 comments on commit 0fe4e48

Please sign in to comment.