commit 95574e45386c066adbd46cb0890df05ab30376a3
parent 630c2c2a080261f9e29eca113ebd2fc958115cf7
Author: James Prestwood <prestwoj@gmail.com>
Date: Tue, 3 Aug 2021 14:40:44 -0700
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.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git 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);