diff --git a/cli-kex.c b/cli-kex.c index dc05501..bad559c 100644 --- a/cli-kex.c +++ b/cli-kex.c @@ -255,5 +255,7 @@ out: fclose(hostsfile); } m_free(filename); - buf_free(line); + if (line != NULL) { + buf_free(line); + } } diff --git a/common-kex.c b/common-kex.c index 0654b19..f8bfe97 100644 --- a/common-kex.c +++ b/common-kex.c @@ -464,6 +464,8 @@ void recv_msg_kexinit() { /* Initialises and generate one side of the diffie-hellman key exchange values. * See the ietf-secsh-transport draft, section 6, for details */ +/* dh_pub and dh_priv will be initialised by this function, and should be + * mp_clear()ed after finished */ void gen_kexdh_vals(mp_int *dh_pub, mp_int *dh_priv) { mp_int dh_p, dh_q, dh_g;