Skip to content

Commit

Permalink
Better error management in verifiable secret sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
nadav-fireblocks committed Nov 26, 2024
1 parent e932d0c commit ac6b6bc
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,11 @@ void verifiable_secret_sharing_free_shares(verifiable_secret_sharing_t *shares)
if (shares)
{
free(shares->ids);
OPENSSL_cleanse(shares->shares, shares->num_shares * sizeof(shamir_secret_sharing_scalar_t));
free(shares->shares);
if (shares->shares)
{
OPENSSL_cleanse(shares->shares, shares->num_shares * sizeof(shamir_secret_sharing_scalar_t));
free(shares->shares);
}
free(shares->proofs);
free(shares->coefficient_proofs);
free(shares);
Expand Down

0 comments on commit ac6b6bc

Please sign in to comment.