From c3d0ebb0bd6e0c3d2dfb7f4d99df362b55e6838c Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Tue, 29 Mar 2022 23:47:30 +0800 Subject: Use buf_burn_free() instead of two calls --- common-kex.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'common-kex.c') diff --git a/common-kex.c b/common-kex.c index 41384d0..6aaec29 100644 --- a/common-kex.c +++ b/common-kex.c @@ -306,8 +306,7 @@ static void gen_new_keys() { 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 @@ void finish_kexhashbuf(void) { } #endif - buf_burn(ses.kexhashbuf); - buf_free(ses.kexhashbuf); + buf_burn_free(ses.kexhashbuf); m_burn(&hs, sizeof(hash_state)); ses.kexhashbuf = NULL; -- cgit v1.2.1