diff common-kex.c @ 1912:8b4274d34fe8

Use buf_burn_free() instead of two calls
author Matt Johnston <matt@ucc.asn.au>
date Tue, 29 Mar 2022 23:47:30 +0800
parents 3bfacfc996cf
children 3f4cdf839a1a
line wrap: on
line diff
--- a/common-kex.c	Tue Mar 29 23:27:55 2022 +0800
+++ b/common-kex.c	Tue Mar 29 23:47:30 2022 +0800
@@ -306,8 +306,7 @@
 	mp_clear(ses.dh_K);
 	m_free(ses.dh_K);
 	hash_desc->process(&hs, ses.hash->data, ses.hash->len);
-	buf_burn(ses.hash);
-	buf_free(ses.hash);
+	buf_burn_free(ses.hash);
 	ses.hash = NULL;
 
 	if (IS_DROPBEAR_CLIENT) {
@@ -803,8 +802,7 @@
 	}
 #endif
 
-	buf_burn(ses.kexhashbuf);
-	buf_free(ses.kexhashbuf);
+	buf_burn_free(ses.kexhashbuf);
 	m_burn(&hs, sizeof(hash_state));
 	ses.kexhashbuf = NULL;