Skip to content

Commit

Permalink
Remove dead code in pack_public_key_ed25519
Browse files Browse the repository at this point in the history
if (ret != 0)
		free(response->public_key);

is dead code; the very last operation before the memcpy and the setting of ret to 0 is the malloc of response->public_key, which means response->public_key is always NULL if pack_public_key_ed25519 fails.
  • Loading branch information
AreaZR committed Jul 16, 2023
1 parent 20b768f commit e1293da
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions sk-usbhid.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,6 @@ pack_public_key_ed25519(const fido_cred_t *cred,
memcpy(response->public_key, ptr, len);
ret = 0;
out:
if (ret != 0)
free(response->public_key);
return ret;
}

Expand Down

0 comments on commit e1293da

Please sign in to comment.