Fix for ECC curve cache without custom curves enabled.

This commit is contained in:
David Garske 2020-08-27 11:18:55 -07:00
parent 3e685fdb5b
commit 32b46e344d

View File

@ -1304,15 +1304,13 @@ static void wc_ecc_curve_free(ecc_curve_spec* curve)
{
if (curve) {
#ifdef ECC_CACHE_CURVE
/* only free custom curves (reset are globally cached) */
if (curve->dp
#ifdef WOLFSSL_CUSTOM_CURVES
&& curve->dp->id == ECC_CURVE_CUSTOM
#endif
) {
/* only free custom curves (reset are globally cached) */
if (curve->dp && curve->dp->id == ECC_CURVE_CUSTOM) {
wc_ecc_curve_cache_free_spec(curve);
XFREE(curve, NULL, DYNAMIC_TYPE_ECC);
}
#endif
#else
wc_ecc_curve_cache_free_spec(curve);
#endif