mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
make_addressPrefix(): Fix a memory leak in error case
Fixes #24098 Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24102)
This commit is contained in:
parent
8e5918fb8e
commit
682ed1b86e
@ -407,11 +407,11 @@ static int make_addressPrefix(IPAddressOrRange **result, unsigned char *addr,
|
||||
const int prefixlen, const int afilen)
|
||||
{
|
||||
int bytelen = (prefixlen + 7) / 8, bitlen = prefixlen % 8;
|
||||
IPAddressOrRange *aor = IPAddressOrRange_new();
|
||||
IPAddressOrRange *aor;
|
||||
|
||||
if (prefixlen < 0 || prefixlen > (afilen * 8))
|
||||
return 0;
|
||||
if (aor == NULL)
|
||||
if ((aor = IPAddressOrRange_new()) == NULL)
|
||||
return 0;
|
||||
aor->type = IPAddressOrRange_addressPrefix;
|
||||
if (aor->u.addressPrefix == NULL &&
|
||||
|
Loading…
Reference in New Issue
Block a user