# HG changeset patch # User Jan Pechanec # Date 1246006202 25200 # Node ID a945dec9643d00aa031d45566ceda978484533d2 # Parent 9a78e9b6760d86f7dcf6633e550b3a1ea47f3cac 6853997 ssh is freeing memory with the hostname it needs later diff -r 9a78e9b6760d -r a945dec9643d usr/src/cmd/ssh/ssh/sshconnect.c --- a/usr/src/cmd/ssh/ssh/sshconnect.c Fri Jun 26 00:59:33 2009 -0700 +++ b/usr/src/cmd/ssh/ssh/sshconnect.c Fri Jun 26 01:50:02 2009 -0700 @@ -1003,6 +1003,10 @@ /* key exchange */ /* authenticate user */ if (compat20) { + /* + * Note that the host pointer is saved in ssh_kex2() for later + * use during the key re-exchanges so we must not xfree() it. + */ ssh_kex2(host, hostaddr); ssh_userauth2(local_user, server_user, host, sensitive); } else { @@ -1010,7 +1014,6 @@ ssh_userauth1(local_user, server_user, host, sensitive); } - xfree(host); xfree(local_user); }