From 12eec3112cc98a74a75f6df07eb8f110bf83f7c0 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sun, 4 Jan 2009 20:58:30 -0500 Subject: [PATCH] Close the cipher handle in crypto_cleanup(); Call munlock() with the same size that mlock() used. --- src/cache.c | 2 +- src/pwmd.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cache.c b/src/cache.c index 731befa2..1da6d65a 100644 --- a/src/cache.c +++ b/src/cache.c @@ -165,7 +165,7 @@ static void free_entry(file_cache_t *p) g_free(p->mutex); memset(p, 0, sizeof(file_cache_t)); - munlock(p, sizeof(file_cache_t)); + munlock(p, sysconf(_SC_PAGESIZE)); key_cache = g_slist_remove(key_cache, p); g_free(p); } diff --git a/src/pwmd.c b/src/pwmd.c index c981ad97..f0dac136 100644 --- a/src/pwmd.c +++ b/src/pwmd.c @@ -455,6 +455,9 @@ void cleanup_crypto(struct client_crypto_s **c) g_free(cr->fh); } + if (cr->gh) + gcry_cipher_close(cr->gh); + g_free(cr); *c = NULL; } -- 2.11.4.GIT