changeset 891:e78f5ce6e7bb

cleanup before clearing keys
author Matt Johnston <matt@ucc.asn.au>
date Wed, 12 Feb 2014 22:15:02 +0800
parents d50c17fe57d7
children ae766a2c8fa7
files common-session.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/common-session.c	Fri Feb 07 07:57:45 2014 +0800
+++ b/common-session.c	Wed Feb 12 22:15:02 2014 +0800
@@ -244,7 +244,11 @@
 	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 @@
 	m_burn(ses.keys, sizeof(struct key_context));
 	m_free(ses.keys);
 
-	chancleanup();
-
 	TRACE(("leave session_cleanup"))
 }