summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/session.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2003-03-05 22:33:43 +0000
committermarkus <markus@openbsd.org>2003-03-05 22:33:43 +0000
commitce850b032b66ce5ec1fcf20b26e03ac295ba3db5 (patch)
tree299a43373b41c270a5c1399d2a1942948eed2ae7 /usr.bin/ssh/session.c
parentdelete blank lines (diff)
downloadwireguard-openbsd-ce850b032b66ce5ec1fcf20b26e03ac295ba3db5.tar.xz
wireguard-openbsd-ce850b032b66ce5ec1fcf20b26e03ac295ba3db5.zip
fix memory leaks; from dlheine@suif.Stanford.EDU/CLOUSEAU; ok djm@
Diffstat (limited to 'usr.bin/ssh/session.c')
-rw-r--r--usr.bin/ssh/session.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index eeb5db00def..1de5fda21b6 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.153 2003/02/06 09:26:23 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.154 2003/03/05 22:33:43 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -823,7 +823,7 @@ do_setup_env(Session *s, const char *shell)
{
char buf[256];
u_int i, envsize;
- char **env;
+ char **env, *laddr;
struct passwd *pw = s->pw;
/* Initialize the environment. */
@@ -878,9 +878,10 @@ do_setup_env(Session *s, const char *shell)
get_remote_ipaddr(), get_remote_port(), get_local_port());
child_set_env(&env, &envsize, "SSH_CLIENT", buf);
+ laddr = get_local_ipaddr(packet_get_connection_in());
snprintf(buf, sizeof buf, "%.50s %d %.50s %d",
- get_remote_ipaddr(), get_remote_port(),
- get_local_ipaddr(packet_get_connection_in()), get_local_port());
+ get_remote_ipaddr(), get_remote_port(), laddr, get_local_port());
+ xfree(laddr);
child_set_env(&env, &envsize, "SSH_CONNECTION", buf);
if (s->ttyfd != -1)