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>
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;