mirror of
https://github.com/clearml/dropbear
synced 2025-02-07 13:21:15 +00:00
Some additional cleanup functions
This commit is contained in:
parent
21bed0d21a
commit
8008b595d3
@ -260,13 +260,16 @@ void session_cleanup() {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Beware of changing order of functions here. */
|
||||
|
||||
/* Must be before extra_session_cleanup() */
|
||||
chancleanup();
|
||||
|
||||
if (ses.extra_session_cleanup) {
|
||||
ses.extra_session_cleanup();
|
||||
}
|
||||
|
||||
chancleanup();
|
||||
|
||||
/* Most dropbear functions are unsafe to run after this point */
|
||||
/* After these are freed most functions will exit */
|
||||
#ifdef DROPBEAR_CLEANUP
|
||||
/* listeners call cleanup functions, this should occur before
|
||||
other session state is freed. */
|
||||
@ -289,6 +292,12 @@ void session_cleanup() {
|
||||
cleanup_buf(&ses.payload);
|
||||
cleanup_buf(&ses.readbuf);
|
||||
cleanup_buf(&ses.writepayload);
|
||||
cleanup_buf(&ses.kexhashbuf);
|
||||
cleanup_buf(&ses.transkexinit);
|
||||
if (ses.dh_K) {
|
||||
mp_clear(ses.dh_K);
|
||||
}
|
||||
m_free(ses.dh_K);
|
||||
|
||||
m_burn(ses.keys, sizeof(struct key_context));
|
||||
m_free(ses.keys);
|
||||
|
@ -83,8 +83,9 @@ svr_session_cleanup(void) {
|
||||
svr_pubkey_options_cleanup();
|
||||
|
||||
m_free(svr_ses.addrstring);
|
||||
m_free(svr_ses.childpids);
|
||||
m_free(svr_ses.remotehost);
|
||||
m_free(svr_ses.childpids);
|
||||
svr_ses.childpidsize = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user