summaryrefslogtreecommitdiffhomepage
path: root/common-session.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2014-02-12 22:15:02 +0800
committerMatt Johnston <matt@ucc.asn.au>2014-02-12 22:15:02 +0800
commita18a6b8db8e86f0870dfd59c84fa286436f79e5c (patch)
treeefa46f1eebd51763f197b7f022858cbd77295f16 /common-session.c
parentbf56591fb8f3010ccdaa7417d7d3b6c625c07060 (diff)
cleanup before clearing keys
Diffstat (limited to 'common-session.c')
-rw-r--r--common-session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common-session.c b/common-session.c
index 40c66e8..6882dce 100644
--- a/common-session.c
+++ b/common-session.c
@@ -244,7 +244,11 @@ void session_cleanup() {
if (ses.extra_session_cleanup) {
ses.extra_session_cleanup();
}
+
+ chancleanup();
+ /* Cleaning up keys must happen after other cleanup
+ functions which might queue packets */
if (ses.session_id) {
buf_burn(ses.session_id);
buf_free(ses.session_id);
@@ -258,8 +262,6 @@ void session_cleanup() {
m_burn(ses.keys, sizeof(struct key_context));
m_free(ses.keys);
- chancleanup();
-
TRACE(("leave session_cleanup"))
}