mirror of
https://github.com/openssl/openssl.git
synced 2024-11-23 18:13:39 +08:00
Fix mem leak on error path
The mem pointed to by cAB can be leaked on an error path. Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
parent
c72b8e069d
commit
85d6b09dda
@ -84,7 +84,7 @@ BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N)
|
||||
|| !EVP_DigestUpdate(ctxt, cAB + BN_bn2bin(A, cAB + longN), longN)
|
||||
|| !EVP_DigestUpdate(ctxt, cAB + BN_bn2bin(B, cAB + longN), longN))
|
||||
goto err;
|
||||
OPENSSL_free(cAB);
|
||||
|
||||
if (!EVP_DigestFinal_ex(ctxt, cu, NULL))
|
||||
goto err;
|
||||
|
||||
@ -94,7 +94,9 @@ BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N)
|
||||
BN_free(u);
|
||||
u = NULL;
|
||||
}
|
||||
|
||||
err:
|
||||
OPENSSL_free(cAB);
|
||||
EVP_MD_CTX_free(ctxt);
|
||||
|
||||
return u;
|
||||
|
Loading…
Reference in New Issue
Block a user