testsc.c: fix further memory leaks.

These were spotted by Leak Sanitiser rather than Coverity: it reported
them while I was checking the fixes for Coverity-spotted issues.
This commit is contained in:
Simon Tatham 2019-05-05 10:13:10 +01:00
Родитель 2b1e0a5e05
Коммит 5f35f5b4ac
1 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -334,6 +334,7 @@ static void test_mp_get_nbits(void)
log_end();
}
mp_free(prev);
mp_free(z);
}
static void test_mp_from_decimal(void)
@ -386,6 +387,7 @@ static void test_mp_string_format(char *(*mp_format)(mp_int *x))
log_end();
sfree(formatted);
}
mp_free(z);
}
static void test_mp_get_decimal(void)
@ -589,6 +591,10 @@ static void test_mp_modarith(
mp_free(out);
}
mp_free(base);
mp_free(exponent);
mp_free(modulus);
}
static void test_mp_modadd(void)
@ -625,6 +631,8 @@ static void test_mp_invert_mod_2to(void)
mp_free(out);
}
mp_free(x);
}
static void test_mp_modsqrt(void)
@ -647,7 +655,8 @@ static void test_mp_modsqrt(void)
/* Do one initial call to cause the lazily initialised sub-context
* to be set up. This will take a while, but it can't be helped. */
mp_modsqrt(sc, x, &success);
mp_int *unwanted = mp_modsqrt(sc, x, &success);
mp_free(unwanted);
for (size_t i = 0; i < looplimit(8); i++) {
mp_random_bits_into(x, bits - 1);
@ -802,6 +811,7 @@ static void test_ecc_weierstrass_multiply(void)
}
ecc_weierstrass_point_free(a);
ecc_weierstrass_curve_free(wc);
mp_free(exponent);
}
static void test_ecc_weierstrass_is_identity(void)
@ -1000,6 +1010,7 @@ static void test_ecc_montgomery_multiply(void)
}
ecc_montgomery_point_free(a);
ecc_montgomery_curve_free(wc);
mp_free(exponent);
}
static void test_ecc_montgomery_get_affine(void)
@ -1132,6 +1143,7 @@ static void test_ecc_edwards_multiply(void)
}
ecc_edwards_point_free(a);
ecc_edwards_curve_free(ec);
mp_free(exponent);
}
static void test_ecc_edwards_eq(void)