[PATCH 10/12 bugfix: openssh-4.3p2: memory leak

Kylene Jo Hall kjhall at us.ibm.com
Tue May 16 06:19:23 EST 2006


The variable local_user was allocated by xstrdup and is not freed or
pointed to in this branch.  This patch adds the xfree.  This entire set
of patches passed the regression tests on my system. Bug found by
Coverity.
Signed-off-by: Kylene Hall <kjhall at us.ibm.com>
---
sshconnect.c |    1 +
1 files changed, 1 insertion(+)

diff -uprN openssh-4.3p2/sshconnect.c openssh-4.3p2-kylie/sshconnect.c
--- openssh-4.3p2/sshconnect.c	2005-12-13 02:29:03.000000000 -0600
+++ openssh-4.3p2-kylie/sshconnect.c	2006-05-04 10:07:57.000000000 -0500
@@ -937,6 +937,7 @@ ssh_login(Sensitive *sensitive, const ch
 	} else {
 		ssh_kex(host, hostaddr);
 		ssh_userauth1(local_user, server_user, host, sensitive);
+		xfree(local_user);
 	}
 }
 





More information about the openssh-unix-dev mailing list