aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-05-29 18:04:23 -0700
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-05-29 18:05:19 -0700
commit654cdae9b69b47c945254812764efd167958704d (patch)
tree36d9b430f8a577382b2610adf4c3a5544dfc32fe
parentc2a7392a0696e0dc982bbc2a7f0e4641e0112106 (diff)
downloadcrda-654cdae9b69b47c945254812764efd167958704d.tar.gz
crda: use gcry_mpi_release() when using gcry_mpi_scan()
Its not well documented you should do this but I found out through valgrind. This fixes the last 4 valgrind issues I was seeing with regdbdump. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rw-r--r--reglib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/reglib.c b/reglib.c
index 3d13782..72ea78f 100644
--- a/reglib.c
+++ b/reglib.c
@@ -158,10 +158,14 @@ int crda_verify_db_signature(uint8_t *db, int dblen, int siglen)
"(public-key (rsa (n %m) (e %m)))",
mpi_n, mpi_e)) {
fprintf(stderr, "Failed to build RSA S-expression.\n");
+ gcry_mpi_release(mpi_e);
+ gcry_mpi_release(mpi_n);
goto out;
}
ok = gcry_pk_verify(signature, data, rsa) == 0;
+ gcry_mpi_release(mpi_e);
+ gcry_mpi_release(mpi_n);
gcry_sexp_release(rsa);
}