pkarse: Update pk_group_id_from_specified() clean-up.

This path updates the clean-up logic of to individually
free each of the the group's structure members
rather than invoke `mbedtls_ecp_group_free()`.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
Minos Galanakis 2023-01-19 16:08:34 +00:00
parent e9fa7a74cd
commit c8e381ab1c

View File

@ -429,7 +429,11 @@ static int pk_group_id_from_specified(const mbedtls_asn1_buf *params,
ret = pk_group_id_from_group(&grp, grp_id);
cleanup:
mbedtls_ecp_group_free(&grp);
mbedtls_mpi_free(&grp.N);
mbedtls_mpi_free(&grp.P);
mbedtls_mpi_free(&grp.A);
mbedtls_mpi_free(&grp.B);
mbedtls_ecp_point_free(&grp.G);
return ret;
}