mirror of
https://github.com/openssl/openssl.git
synced 2025-03-31 20:10:45 +08:00
Free tempory data on error in ec_wNAF_mul()
The ec_wNAF_mul() function allocates some temporary storage that it doesn't always free on an error condition. Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
ff3bb913cf
commit
0e9eb1a57b
@ -312,6 +312,7 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
|
||||
numblocks = (tmp_len + blocksize - 1) / blocksize;
|
||||
if (numblocks > pre_comp->numblocks) {
|
||||
ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR);
|
||||
OPENSSL_free(tmp_wNAF);
|
||||
goto err;
|
||||
}
|
||||
totalnum = num + numblocks;
|
||||
@ -326,6 +327,7 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
|
||||
wNAF_len[i] = blocksize;
|
||||
if (tmp_len < blocksize) {
|
||||
ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR);
|
||||
OPENSSL_free(tmp_wNAF);
|
||||
goto err;
|
||||
}
|
||||
tmp_len -= blocksize;
|
||||
|
Loading…
x
Reference in New Issue
Block a user