diff --git a/crypto/ec/ecp_smpl.c b/crypto/ec/ecp_smpl.c index ee0c46841b..2d42d34f51 100644 --- a/crypto/ec/ecp_smpl.c +++ b/crypto/ec/ecp_smpl.c @@ -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;