diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2014-01-25 03:21:39 +0400 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-01-27 14:33:33 +0100 |
commit | 5c150ece094bf0a504a111ce6c7b72e8d0b0457a (patch) | |
tree | e8a5cec45e886448b472eaa9d45990d75ed19c9c /tests/t-mpi-point.c | |
parent | 6d87e6abdfb7552323a95401f14e6367398a3e5a (diff) | |
download | libgcrypt-5c150ece094bf0a504a111ce6c7b72e8d0b0457a.tar.gz |
Fix most of memory leaks in tests code
* tests/basic.c (check_ccm_cipher): Close cipher after use.
* tests/basic.c (check_one_cipher): Correct length of used buffer.
* tests/benchmark.c (cipher_bench): Use xcalloc to make buffer
initialized.
* tests/keygen.c (check_ecc_keys): Release generated key.
* tests/t-mpi-point.c (context_param): Release mpi Q.
* tests/t-sexp.c (check_extract_param): Release extracted number.
--
The only remaining reported memory leak is one expected leak from
mpitests.c.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'tests/t-mpi-point.c')
-rw-r--r-- | tests/t-mpi-point.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/t-mpi-point.c b/tests/t-mpi-point.c index d60b3f0a..88bb5bdf 100644 --- a/tests/t-mpi-point.c +++ b/tests/t-mpi-point.c @@ -601,6 +601,7 @@ context_param (void) if (err) fail ("setting Q for nistp256 failed: %s\n", gpg_strerror (err)); get_and_cmp_mpi ("q", sample_p256_q, "nistp256(2)", ctx); + gcry_mpi_release (q); /* Get as s-expression. */ err = gcry_pubkey_get_sexp (&sexp, 0, ctx); |