summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtp_session.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-05-17 14:00:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-05-17 14:00:07 +0000
commit3f8ade0e6c3b7d7bb1b8dd3ceb6f17423c26eef6 (patch)
tree6e65b24c6a93c5e1360389e1d21fd628e735ebba /usr.sbin/smtpd/smtp_session.c
parent6bcb5efb8ee6bc46d0c11860276540aa3f90d119 (diff)
Introduce more use of freezero(). Also, remove ptr conditionals before
many functions which are free(NULL)-compat ok gilles
Diffstat (limited to 'usr.sbin/smtpd/smtp_session.c')
-rw-r--r--usr.sbin/smtpd/smtp_session.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index c4c0ac9d18e..7790a3b0270 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.302 2016/11/30 17:43:32 eric Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.303 2017/05/17 14:00:06 deraadt Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -962,8 +962,7 @@ smtp_session_imsg(struct mproc *p, struct imsg *imsg)
io_set_read(s->io);
io_start_tls(s->io, ssl);
- explicit_bzero(resp_ca_cert->cert, resp_ca_cert->cert_len);
- free(resp_ca_cert->cert);
+ freezero(resp_ca_cert->cert, resp_ca_cert->cert_len);
free(resp_ca_cert);
return;
@@ -1205,8 +1204,7 @@ smtp_filter_fd(uint64_t id, int fd)
SSL_get_cipher_name(io_ssl(s->io)),
SSL_get_cipher_bits(io_ssl(s->io), NULL),
(s->flags & SF_VERIFIED) ? "YES" : (x ? "FAIL" : "NO"));
- if (x)
- X509_free(x);
+ X509_free(x);
if (s->listener->flags & F_RECEIVEDAUTH) {
io_printf(s->tx->oev, " auth=%s", s->username[0] ? "yes" : "no");