summaryrefslogtreecommitdiff
path: root/usr.sbin/acme-client/main.c
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2019-03-09 18:07:41 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2019-03-09 18:07:41 +0000
commitebbf205bcd31aba3faedbbe1828081771d17b24e (patch)
tree3acbc0b528952af85203de7681699a7e35b8a9e1 /usr.sbin/acme-client/main.c
parent328ba31b64867fa58073116d02b860790a6cd359 (diff)
remove free() before exit() from main(), in ongoing work to make
things more readable. otto notes that free() does some checks, but in this case readability is better than complete cleanup. ok florian@ deraadt@
Diffstat (limited to 'usr.sbin/acme-client/main.c')
-rw-r--r--usr.sbin/acme-client/main.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/usr.sbin/acme-client/main.c b/usr.sbin/acme-client/main.c
index 564290e6720..bbedeb76357 100644
--- a/usr.sbin/acme-client/main.c
+++ b/usr.sbin/acme-client/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.44 2019/03/09 10:11:53 benno Exp $ */
+/* $Id: main.c,v 1.45 2019/03/09 18:07:40 benno Exp $ */
/*
* Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -238,7 +238,6 @@ main(int argc, char *argv[])
if (pids[COMP_NET] == 0) {
proccomp = COMP_NET;
- free(certdir);
close(key_fds[0]);
close(acct_fds[0]);
close(chng_fds[0]);
@@ -252,7 +251,6 @@ main(int argc, char *argv[])
dns_fds[1], rvk_fds[1],
(popts & ACME_OPT_NEWACCT), revocate, authority,
(const char *const *)alts, altsz);
- free(alts);
exit(c ? EXIT_SUCCESS : EXIT_FAILURE);
}
@@ -270,7 +268,6 @@ main(int argc, char *argv[])
if (pids[COMP_KEY] == 0) {
proccomp = COMP_KEY;
- free(certdir);
close(cert_fds[0]);
close(dns_fds[0]);
close(rvk_fds[0]);
@@ -280,7 +277,6 @@ main(int argc, char *argv[])
close(file_fds[1]);
c = keyproc(key_fds[0], domain->key,
(const char **)alts, altsz, (popts & ACME_OPT_NEWDKEY));
- free(alts);
exit(c ? EXIT_SUCCESS : EXIT_FAILURE);
}
@@ -293,8 +289,6 @@ main(int argc, char *argv[])
if (pids[COMP_ACCOUNT] == 0) {
proccomp = COMP_ACCOUNT;
- free(certdir);
- free(alts);
close(cert_fds[0]);
close(dns_fds[0]);
close(rvk_fds[0]);
@@ -314,8 +308,6 @@ main(int argc, char *argv[])
if (pids[COMP_CHALLENGE] == 0) {
proccomp = COMP_CHALLENGE;
- free(certdir);
- free(alts);
close(cert_fds[0]);
close(dns_fds[0]);
close(rvk_fds[0]);
@@ -334,8 +326,6 @@ main(int argc, char *argv[])
if (pids[COMP_CERT] == 0) {
proccomp = COMP_CERT;
- free(certdir);
- free(alts);
close(dns_fds[0]);
close(rvk_fds[0]);
close(file_fds[1]);
@@ -353,12 +343,10 @@ main(int argc, char *argv[])
if (pids[COMP_FILE] == 0) {
proccomp = COMP_FILE;
- free(alts);
close(dns_fds[0]);
close(rvk_fds[0]);
c = fileproc(file_fds[1], certdir, certfile, chainfile,
fullchainfile);
- free(certdir);
/*
* This is different from the other processes in that it
* can return 2 if the certificates were updated.
@@ -375,8 +363,6 @@ main(int argc, char *argv[])
if (pids[COMP_DNS] == 0) {
proccomp = COMP_DNS;
- free(certdir);
- free(alts);
close(rvk_fds[0]);
c = dnsproc(dns_fds[0]);
exit(c ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -395,8 +381,6 @@ main(int argc, char *argv[])
certfile != NULL ? certfile : fullchainfile,
force, revocate,
(const char *const *)alts, altsz);
- free(certdir);
- free(alts);
exit(c ? EXIT_SUCCESS : EXIT_FAILURE);
}
@@ -421,11 +405,6 @@ main(int argc, char *argv[])
checkexit(pids[COMP_DNS], COMP_DNS) +
checkexit(pids[COMP_REVOKE], COMP_REVOKE);
- free(certdir);
- free(alts);
- free(certfile);
- free(chainfile);
- free(fullchainfile);
return rc != COMP__MAX ? EXIT_FAILURE : (c == 2 ? EXIT_SUCCESS : 2);
usage:
fprintf(stderr,