Skip to content

Commit

Permalink
cleanup cbor_encode_pubkey_param()
Browse files Browse the repository at this point in the history
  • Loading branch information
bobomb committed Jan 11, 2024
1 parent ef55990 commit b0f19d1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/cbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ cbor_encode_pubkey_param(fido_int_array_t *cose_alg_array)
cbor_item_t *item = NULL;
cbor_item_t *body = NULL;
struct cbor_pair alg;
int ok = -1;

memset(&alg, 0, sizeof(alg));

Expand Down Expand Up @@ -515,15 +514,12 @@ cbor_encode_pubkey_param(fido_int_array_t *cose_alg_array)
memset(&alg, 0, sizeof(alg));
}

ok = 0;

return (item);
fail:
if (ok < 0) {
if (item != NULL) {
cbor_decref(&item);
item = NULL;
}

if (item != NULL) {
cbor_decref(&item);
item = NULL;
}

if (body != NULL)
Expand Down

0 comments on commit b0f19d1

Please sign in to comment.