View | Details | Raw Unified | Return to bug 2962
Collapse All | Expand All

(-)a/packet.c (+4 lines)
Lines 638-643 ssh_packet_close_internal(struct ssh *ssh, int do_close) Link Here
638
	cipher_free(state->receive_context);
638
	cipher_free(state->receive_context);
639
	state->send_context = state->receive_context = NULL;
639
	state->send_context = state->receive_context = NULL;
640
	if (do_close) {
640
	if (do_close) {
641
		if (ssh->kex) {
642
			kex_free(ssh->kex);
643
			ssh->kex = NULL;
644
		}
641
		free(ssh->local_ipaddr);
645
		free(ssh->local_ipaddr);
642
		ssh->local_ipaddr = NULL;
646
		ssh->local_ipaddr = NULL;
643
		free(ssh->remote_ipaddr);
647
		free(ssh->remote_ipaddr);
(-)a/ssh.c (-5 / +9 lines)
Lines 169-175 char *host; Link Here
169
169
170
/* Various strings used to to percent_expand() arguments */
170
/* Various strings used to to percent_expand() arguments */
171
static char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV];
171
static char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV];
172
static char uidstr[32], *host_arg, *conn_hash_hex;
172
static char uidstr[32], *conn_hash_hex;
173
173
174
/* socket address the host resolves to */
174
/* socket address the host resolves to */
175
struct sockaddr_storage hostaddr;
175
struct sockaddr_storage hostaddr;
Lines 207-213 usage(void) Link Here
207
	exit(255);
207
	exit(255);
208
}
208
}
209
209
210
static int ssh_session2(struct ssh *, struct passwd *);
210
static int ssh_session2(struct ssh *, struct passwd *, char *host_arg);
211
static void load_public_identity_files(struct passwd *);
211
static void load_public_identity_files(struct passwd *);
212
static void main_sigchld_handler(int);
212
static void main_sigchld_handler(int);
213
213
Lines 584-590 main(int ac, char **av) Link Here
584
	struct ssh *ssh = NULL;
584
	struct ssh *ssh = NULL;
585
	int i, r, opt, exit_status, use_syslog, direct, timeout_ms;
585
	int i, r, opt, exit_status, use_syslog, direct, timeout_ms;
586
	int was_addr, config_test = 0, opt_terminated = 0, want_final_pass = 0;
586
	int was_addr, config_test = 0, opt_terminated = 0, want_final_pass = 0;
587
	char *p, *cp, *line, *argv0, buf[PATH_MAX], *logfile;
587
	char *p, *cp, *line, *argv0, buf[PATH_MAX], *logfile, *host_arg;
588
	char cname[NI_MAXHOST];
588
	char cname[NI_MAXHOST];
589
	struct stat st;
589
	struct stat st;
590
	struct passwd *pw;
590
	struct passwd *pw;
Lines 1523-1530 main(int ac, char **av) Link Here
1523
	}
1523
	}
1524
1524
1525
 skip_connect:
1525
 skip_connect:
1526
	exit_status = ssh_session2(ssh, pw);
1526
	exit_status = ssh_session2(ssh, pw, host_arg);
1527
	ssh_packet_close(ssh);
1527
	ssh_packet_close(ssh);
1528
	free(ssh);
1529
	ssh = NULL;
1530
	free(host_arg);
1531
	host_arg = NULL;
1528
1532
1529
	if (options.control_path != NULL && muxserver_sock != -1)
1533
	if (options.control_path != NULL && muxserver_sock != -1)
1530
		unlink(options.control_path);
1534
		unlink(options.control_path);
Lines 1873-1879 ssh_session2_open(struct ssh *ssh) Link Here
1873
}
1877
}
1874
1878
1875
static int
1879
static int
1876
ssh_session2(struct ssh *ssh, struct passwd *pw)
1880
ssh_session2(struct ssh *ssh, struct passwd *pw, char *host_arg)
1877
{
1881
{
1878
	int r, devnull, id = -1;
1882
	int r, devnull, id = -1;
1879
	char *cp, *tun_fwd_ifname = NULL;
1883
	char *cp, *tun_fwd_ifname = NULL;

Return to bug 2962