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
1 changed files with 3 additions and 6 deletions
|
@ -133,12 +133,9 @@ int ec_GFp_simple_group_init(EC_GROUP *group)
|
||||||
group->a = BN_new();
|
group->a = BN_new();
|
||||||
group->b = BN_new();
|
group->b = BN_new();
|
||||||
if (!group->field || !group->a || !group->b) {
|
if (!group->field || !group->a || !group->b) {
|
||||||
if (!group->field)
|
BN_free(group->field);
|
||||||
BN_free(group->field);
|
BN_free(group->a);
|
||||||
if (!group->a)
|
BN_free(group->b);
|
||||||
BN_free(group->a);
|
|
||||||
if (!group->b)
|
|
||||||
BN_free(group->b);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
group->a_is_minus3 = 0;
|
group->a_is_minus3 = 0;
|
||||||
|
|
Loading…
Reference in a new issue