summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2015-09-04 08:21:47 +0000
committerDamien Miller <djm@mindrot.org>2015-09-11 13:28:00 +1000
commit4f7cc2f8cc861a21e6dbd7f6c25652afb38b9b96 (patch)
treeac729ec5e2b5f386d982ba870cb5c4589d127dd8 /sshd.c
parent7ad8b287c8453a3e61dbc0d34d467632b8b06fc8 (diff)
upstream commit
Plug minor memory leaks when options are used more than once. bz#2182, patch from Tiago Cunha, ok deraadt djm Upstream-ID: 5b84d0401e27fe1614c10997010cc55933adb48e
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sshd.c b/sshd.c
index 65ef7e850..d86808912 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.458 2015/08/20 22:32:42 deraadt Exp $ */ 1/* $OpenBSD: sshd.c,v 1.459 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
@@ -1530,7 +1530,7 @@ main(int ac, char **av)
1530 no_daemon_flag = 1; 1530 no_daemon_flag = 1;
1531 break; 1531 break;
1532 case 'E': 1532 case 'E':
1533 logfile = xstrdup(optarg); 1533 logfile = optarg;
1534 /* FALLTHROUGH */ 1534 /* FALLTHROUGH */
1535 case 'e': 1535 case 'e':
1536 log_stderr = 1; 1536 log_stderr = 1;
@@ -1632,10 +1632,8 @@ main(int ac, char **av)
1632#endif 1632#endif
1633 1633
1634 /* If requested, redirect the logs to the specified logfile. */ 1634 /* If requested, redirect the logs to the specified logfile. */
1635 if (logfile != NULL) { 1635 if (logfile != NULL)
1636 log_redirect_stderr_to(logfile); 1636 log_redirect_stderr_to(logfile);
1637 free(logfile);
1638 }
1639 /* 1637 /*
1640 * Force logging to stderr until we have loaded the private host 1638 * Force logging to stderr until we have loaded the private host
1641 * key (unless started from inetd) 1639 * key (unless started from inetd)