From 22a7c867db16229a9154b138d2239f2387e29106 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Sat, 14 Dec 2024 22:20:33 +0800 Subject: [PATCH] Fix missing cleanup of trans.zstream --- src/common-session.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common-session.c b/src/common-session.c index bea2d788..c9a76a0c 100644 --- a/src/common-session.c +++ b/src/common-session.c @@ -332,6 +332,12 @@ void session_cleanup() { } m_free(ses.keys->recv.zstream); } + if (ses.keys->trans.zstream != NULL) { + if (deflateEnd(ses.keys->trans.zstream) == Z_STREAM_ERROR) { + dropbear_exit("Crypto error"); + } + m_free(ses.keys->trans.zstream); + } #endif m_free(ses.remoteident);