diff fuzzer-kexdh.c @ 1609:a57822db3eac

Fix leaks in kex fuzzers
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Mar 2018 23:16:37 +0800
parents 98d2b125eb89
children
line wrap: on
line diff
--- a/fuzzer-kexdh.c	Fri Mar 09 20:43:11 2018 +0800
+++ b/fuzzer-kexdh.c	Fri Mar 09 23:16:37 2018 +0800
@@ -57,10 +57,14 @@
 		ses.kexhashbuf = buf_new(KEXHASHBUF_MAX_INTS);
 		kexdh_comb_key(dh_param, &dh_e, svr_opts.hostkey);
 
-		/* kexhashbuf is freed in kexdh_comb_key */
+		mp_clear(ses.dh_K);
 		m_free(ses.dh_K);
 		mp_clear(&dh_e);
 
+		buf_free(ses.hash);
+		buf_free(ses.session_id);
+		/* kexhashbuf is freed in kexdh_comb_key */
+
 		m_malloc_free_epoch(1, 0);
 	} else {
 		m_malloc_free_epoch(1, 1);