summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-03-10 11:21:17 +1100
committerDamien Miller <djm@mindrot.org>2003-03-10 11:21:17 +1100
commit0011138d47e284273ba77415f7162aaab60d9a44 (patch)
treec175bfc5d470a641dfc727490eec5765903992d2 /session.c
parent73942b9d54ec71ae76e58d5bf3b06f094bfc3002 (diff)
- (djm) OpenBSD CVS Sync
- markus@cvs.openbsd.org 2003/03/05 22:33:43 [channels.c monitor.c scp.c session.c sftp-client.c sftp-int.c] [sftp-server.c ssh-add.c sshconnect2.c] fix memory leaks; from dlheine@suif.Stanford.EDU/CLOUSEAU; ok djm@
Diffstat (limited to 'session.c')
-rw-r--r--session.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/session.c b/session.c
index a1586d3b4..ce9db27ef 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.153 2003/02/06 09:26:23 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.154 2003/03/05 22:33:43 markus Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -951,7 +951,7 @@ do_setup_env(Session *s, const char *shell)
951{ 951{
952 char buf[256]; 952 char buf[256];
953 u_int i, envsize; 953 u_int i, envsize;
954 char **env; 954 char **env, *laddr;
955 struct passwd *pw = s->pw; 955 struct passwd *pw = s->pw;
956 956
957 /* Initialize the environment. */ 957 /* Initialize the environment. */
@@ -1030,9 +1030,10 @@ do_setup_env(Session *s, const char *shell)
1030 get_remote_ipaddr(), get_remote_port(), get_local_port()); 1030 get_remote_ipaddr(), get_remote_port(), get_local_port());
1031 child_set_env(&env, &envsize, "SSH_CLIENT", buf); 1031 child_set_env(&env, &envsize, "SSH_CLIENT", buf);
1032 1032
1033 laddr = get_local_ipaddr(packet_get_connection_in());
1033 snprintf(buf, sizeof buf, "%.50s %d %.50s %d", 1034 snprintf(buf, sizeof buf, "%.50s %d %.50s %d",
1034 get_remote_ipaddr(), get_remote_port(), 1035 get_remote_ipaddr(), get_remote_port(), laddr, get_local_port());
1035 get_local_ipaddr(packet_get_connection_in()), get_local_port()); 1036 xfree(laddr);
1036 child_set_env(&env, &envsize, "SSH_CONNECTION", buf); 1037 child_set_env(&env, &envsize, "SSH_CONNECTION", buf);
1037 1038
1038 if (s->ttyfd != -1) 1039 if (s->ttyfd != -1)