From 95574e45386c066adbd46cb0890df05ab30376a3 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 3 Aug 2021 14:40:44 -0700 Subject: [PATCH] handshake: unref erp_cache when handshake is freed This makes the erp_cache ownership more consisten rather than relying on the ERP state to free the cache. --- src/handshake.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/handshake.c b/src/handshake.c index 2bce6b8c..5f6b25f4 100644 --- a/src/handshake.c +++ b/src/handshake.c @@ -41,6 +41,7 @@ #include "src/ie.h" #include "src/util.h" #include "src/handshake.h" +#include "src/erp.h" static inline unsigned int n_ecc_groups() { @@ -106,6 +107,9 @@ void handshake_state_free(struct handshake_state *s) l_free(s->mde); l_free(s->fte); + if (s->erp_cache) + erp_cache_put(s->erp_cache); + if (s->passphrase) { explicit_bzero(s->passphrase, strlen(s->passphrase)); l_free(s->passphrase);