comparison 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
comparison
equal deleted inserted replaced
1608:97335566a3bb 1609:a57822db3eac
55 } 55 }
56 56
57 ses.kexhashbuf = buf_new(KEXHASHBUF_MAX_INTS); 57 ses.kexhashbuf = buf_new(KEXHASHBUF_MAX_INTS);
58 kexdh_comb_key(dh_param, &dh_e, svr_opts.hostkey); 58 kexdh_comb_key(dh_param, &dh_e, svr_opts.hostkey);
59 59
60 /* kexhashbuf is freed in kexdh_comb_key */ 60 mp_clear(ses.dh_K);
61 m_free(ses.dh_K); 61 m_free(ses.dh_K);
62 mp_clear(&dh_e); 62 mp_clear(&dh_e);
63
64 buf_free(ses.hash);
65 buf_free(ses.session_id);
66 /* kexhashbuf is freed in kexdh_comb_key */
63 67
64 m_malloc_free_epoch(1, 0); 68 m_malloc_free_epoch(1, 0);
65 } else { 69 } else {
66 m_malloc_free_epoch(1, 1); 70 m_malloc_free_epoch(1, 1);
67 TRACE(("dropbear_exit longjmped")) 71 TRACE(("dropbear_exit longjmped"))