mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
Fix memory leak
It should have freed them when != NULL, not when == NULL. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Viktor Dukhovni <openssl-users@dukhovni.org>
This commit is contained in:
parent
8ec5c5dd36
commit
a38537721d
@ -133,12 +133,9 @@ int ec_GFp_simple_group_init(EC_GROUP *group)
|
||||
group->a = BN_new();
|
||||
group->b = BN_new();
|
||||
if (!group->field || !group->a || !group->b) {
|
||||
if (!group->field)
|
||||
BN_free(group->field);
|
||||
if (!group->a)
|
||||
BN_free(group->a);
|
||||
if (!group->b)
|
||||
BN_free(group->b);
|
||||
BN_free(group->field);
|
||||
BN_free(group->a);
|
||||
BN_free(group->b);
|
||||
return 0;
|
||||
}
|
||||
group->a_is_minus3 = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user