Free temporary arrays

This commit is contained in:
Ramana Kumar 2022-09-17 18:21:56 +01:00
parent dcf68949b3
commit f7053514b3
No known key found for this signature in database
GPG Key ID: ED471C788B900433

View File

@ -119,6 +119,8 @@ C_KZG_RET eval_poly_l(fr_t *out, const poly_l *p, const fr_t *x, const FFTSettin
for (i = 0; i < p->length; i++) {
if (fr_equal(x, &fs->expanded_roots_of_unity[i * stride])) {
*out = p->values[i];
free(inverses_in);
free(inverses);
return C_KZG_OK;
}
fr_sub(&inverses_in[i], x, &fs->expanded_roots_of_unity[i * stride]);
@ -137,6 +139,9 @@ C_KZG_RET eval_poly_l(fr_t *out, const poly_l *p, const fr_t *x, const FFTSettin
fr_sub(&tmp, &tmp, &fr_one);
fr_mul(out, out, &tmp);
free(inverses_in);
free(inverses);
return C_KZG_OK;
}