Bugzilla – Attachment 2387 Details for
Bug 2182
getopt(3) command-line arguments memleaks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Plug getopt(3) command-line arguments memleaks
getopt-memleaks.diff (text/plain), 2.38 KB, created by
Tiago Cunha
on 2013-12-11 01:28:26 AEDT
(
hide
)
Description:
Plug getopt(3) command-line arguments memleaks
Filename:
MIME Type:
Creator:
Tiago Cunha
Created:
2013-12-11 01:28:26 AEDT
Size:
2.38 KB
patch
obsolete
>Index: ssh.c >=================================================================== >RCS file: /home/tiago/src/cvsroot/src/usr.bin/ssh/ssh.c,v >retrieving revision 1.396 >diff -u -p -u -p -r1.396 ssh.c >--- ssh.c 6 Dec 2013 13:39:49 -0000 1.396 >+++ ssh.c 9 Dec 2013 17:12:32 -0000 >@@ -458,7 +458,7 @@ main(int ac, char **av) > use_syslog = 1; > break; > case 'E': >- logfile = xstrdup(optarg); >+ logfile = optarg; > break; > case 'Y': > options.forward_x11 = 1; >@@ -535,6 +535,7 @@ main(int ac, char **av) > break; > case 'I': > #ifdef ENABLE_PKCS11 >+ free(options.pkcs11_provider); > options.pkcs11_provider = xstrdup(optarg); > #else > fprintf(stderr, "no support for PKCS#11.\n"); >@@ -612,6 +613,7 @@ main(int ac, char **av) > case 'c': > if (ciphers_valid(optarg)) { > /* SSH2 only */ >+ free(options.ciphers); > options.ciphers = xstrdup(optarg); > options.cipher = SSH_CIPHER_INVALID; > } else { >@@ -632,9 +634,10 @@ main(int ac, char **av) > } > break; > case 'm': >- if (mac_valid(optarg)) >+ if (mac_valid(optarg)) { >+ free(options.macs); > options.macs = xstrdup(optarg); >- else { >+ } else { > fprintf(stderr, "Unknown mac type '%s'\n", > optarg); > exit(255); >@@ -794,10 +797,8 @@ main(int ac, char **av) > */ > if (use_syslog && logfile != NULL) > fatal("Can't specify both -y and -E"); >- if (logfile != NULL) { >+ if (logfile != NULL) > log_redirect_stderr_to(logfile); >- free(logfile); >- } > log_init(argv0, > options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, > SYSLOG_FACILITY_USER, !use_syslog); >Index: sshd.c >=================================================================== >RCS file: /home/tiago/src/cvsroot/src/usr.bin/ssh/sshd.c,v >retrieving revision 1.412 >diff -u -p -u -p -r1.412 sshd.c >--- sshd.c 6 Dec 2013 13:39:49 -0000 1.412 >+++ sshd.c 9 Dec 2013 17:10:18 -0000 >@@ -1384,7 +1384,7 @@ main(int ac, char **av) > no_daemon_flag = 1; > break; > case 'E': >- logfile = xstrdup(optarg); >+ logfile = optarg; > /* FALLTHROUGH */ > case 'e': > log_stderr = 1; >@@ -1484,10 +1484,8 @@ main(int ac, char **av) > OpenSSL_add_all_algorithms(); > > /* If requested, redirect the logs to the specified logfile. */ >- if (logfile != NULL) { >+ if (logfile != NULL) > log_redirect_stderr_to(logfile); >- free(logfile); >- } > /* > * Force logging to stderr until we have loaded the private host > * key (unless started from inetd)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2182
:
2386
| 2387