summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ssh.c b/ssh.c
index 6053db219..bf8c9c646 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.421 2015/09/04 04:56:09 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.422 2015/09/04 08:21:47 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -627,7 +627,7 @@ main(int ac, char **av)
627 use_syslog = 1; 627 use_syslog = 1;
628 break; 628 break;
629 case 'E': 629 case 'E':
630 logfile = xstrdup(optarg); 630 logfile = optarg;
631 break; 631 break;
632 case 'G': 632 case 'G':
633 config_test = 1; 633 config_test = 1;
@@ -714,6 +714,7 @@ main(int ac, char **av)
714 break; 714 break;
715 case 'I': 715 case 'I':
716#ifdef ENABLE_PKCS11 716#ifdef ENABLE_PKCS11
717 free(options.pkcs11_provider);
717 options.pkcs11_provider = xstrdup(optarg); 718 options.pkcs11_provider = xstrdup(optarg);
718#else 719#else
719 fprintf(stderr, "no support for PKCS#11.\n"); 720 fprintf(stderr, "no support for PKCS#11.\n");
@@ -798,6 +799,7 @@ main(int ac, char **av)
798 if (ciphers_valid(*optarg == '+' ? 799 if (ciphers_valid(*optarg == '+' ?
799 optarg + 1 : optarg)) { 800 optarg + 1 : optarg)) {
800 /* SSH2 only */ 801 /* SSH2 only */
802 free(options.ciphers);
801 options.ciphers = xstrdup(optarg); 803 options.ciphers = xstrdup(optarg);
802 options.cipher = SSH_CIPHER_INVALID; 804 options.cipher = SSH_CIPHER_INVALID;
803 break; 805 break;
@@ -817,9 +819,10 @@ main(int ac, char **av)
817 options.ciphers = xstrdup(KEX_CLIENT_ENCRYPT); 819 options.ciphers = xstrdup(KEX_CLIENT_ENCRYPT);
818 break; 820 break;
819 case 'm': 821 case 'm':
820 if (mac_valid(optarg)) 822 if (mac_valid(optarg)) {
823 free(options.macs);
821 options.macs = xstrdup(optarg); 824 options.macs = xstrdup(optarg);
822 else { 825 } else {
823 fprintf(stderr, "Unknown mac type '%s'\n", 826 fprintf(stderr, "Unknown mac type '%s'\n",
824 optarg); 827 optarg);
825 exit(255); 828 exit(255);
@@ -980,10 +983,8 @@ main(int ac, char **av)
980 */ 983 */
981 if (use_syslog && logfile != NULL) 984 if (use_syslog && logfile != NULL)
982 fatal("Can't specify both -y and -E"); 985 fatal("Can't specify both -y and -E");
983 if (logfile != NULL) { 986 if (logfile != NULL)
984 log_redirect_stderr_to(logfile); 987 log_redirect_stderr_to(logfile);
985 free(logfile);
986 }
987 log_init(argv0, 988 log_init(argv0,
988 options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, 989 options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level,
989 SYSLOG_FACILITY_USER, !use_syslog); 990 SYSLOG_FACILITY_USER, !use_syslog);