mirror of
https://github.com/openssl/openssl.git
synced 2025-03-13 19:47:47 +08:00
Fix memory leak on failure in copy_issuer()
When sk_GENERAL_NAME_reserve() fails, ialt is not freed. Add the freeing operation in the common error path. Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/25876)
This commit is contained in:
parent
83b62d41b2
commit
fa856b0ce0
@ -335,7 +335,7 @@ static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method,
|
||||
|
||||
static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens)
|
||||
{
|
||||
GENERAL_NAMES *ialt;
|
||||
GENERAL_NAMES *ialt = NULL;
|
||||
GENERAL_NAME *gen;
|
||||
X509_EXTENSION *ext;
|
||||
int i, num;
|
||||
@ -370,6 +370,7 @@ static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens)
|
||||
return 1;
|
||||
|
||||
err:
|
||||
sk_GENERAL_NAME_free(ialt);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user