summaryrefslogtreecommitdiffhomepage
path: root/svr-session.c
diff options
context:
space:
mode:
Diffstat (limited to 'svr-session.c')
-rw-r--r--svr-session.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/svr-session.c b/svr-session.c
index 343cb30..8485905 100644
--- a/svr-session.c
+++ b/svr-session.c
@@ -78,10 +78,14 @@ static const struct ChanType *svr_chantypes[] = {
};
static void
-svr_session_cleanup(void)
-{
+svr_session_cleanup(void) {
/* free potential public key options */
svr_pubkey_options_cleanup();
+
+ m_free(svr_ses.addrstring);
+ m_free(svr_ses.remotehost);
+ m_free(svr_ses.childpids);
+ svr_ses.childpidsize = 0;
}
static void
@@ -150,6 +154,7 @@ void svr_session(int sock, int childpipe) {
void svr_dropbear_exit(int exitcode, const char* format, va_list param) {
char fmtbuf[300];
+ int i;
if (!sessinitdone) {
/* before session init */
@@ -183,6 +188,15 @@ void svr_dropbear_exit(int exitcode, const char* format, va_list param) {
session_cleanup();
}
+ if (svr_opts.hostkey) {
+ sign_key_free(svr_opts.hostkey);
+ svr_opts.hostkey = NULL;
+ }
+ for (i = 0; i < DROPBEAR_MAX_PORTS; i++) {
+ m_free(svr_opts.addresses[i]);
+ m_free(svr_opts.ports[i]);
+ }
+
exit(exitcode);
}