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:
@@ -133,11 +133,8 @@ 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);
|
||||||
if (!group->a)
|
|
||||||
BN_free(group->a);
|
BN_free(group->a);
|
||||||
if (!group->b)
|
|
||||||
BN_free(group->b);
|
BN_free(group->b);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user