The documentation of ecc_set_curve and ecc_free have no mention of each other now.
But the following code leaks memory:
ltc_ecc_curve const * cu = 0;
if (CRYPT_OK != ecc_find_curve("P-256", &cu))
return;
for (unsigned i = 0; i < 100000000; ++i)
{
ecc_key key;
if (CRYPT_OK != ecc_set_curve(cu, &key))
return;
}
Should I call ecc_free after a successful ecc_set_curve followed by a failed ecc_set_key .etc?