diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2012-10-03 16:43:20 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2012-10-03 16:43:20 +0000 |
commit | dda472ec5c5ed8fb58070f3d9ca58cd49d608ac9 (patch) | |
tree | bb596c2d9a572516c9ac1c6a58c6bda1f6174d8e /usr.sbin | |
parent | 40e3b31eb52791f78d8294f973e18e478768dd5a (diff) |
don't try to cope with iobuf_init() failure, make it fatal() instead.
from eric@ input
ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/bounce.c | 10 | ||||
-rw-r--r-- | usr.sbin/smtpd/mta_session.c | 10 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtp.c | 8 |
3 files changed, 9 insertions, 19 deletions
diff --git a/usr.sbin/smtpd/bounce.c b/usr.sbin/smtpd/bounce.c index af0d6432da4..c68e8bd431f 100644 --- a/usr.sbin/smtpd/bounce.c +++ b/usr.sbin/smtpd/bounce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bounce.c,v 1.49 2012/10/02 12:37:38 chl Exp $ */ +/* $OpenBSD: bounce.c,v 1.50 2012/10/03 16:43:19 chl Exp $ */ /* * Copyright (c) 2009 Gilles Chehade <gilles@openbsd.org> @@ -166,12 +166,8 @@ bounce_run(uint64_t id, int fd) } bounce->state = BOUNCE_EHLO; - if (iobuf_init(&bounce->iobuf, 0, 0) == -1) { - bounce_status(bounce, "iobuf_init"); - bounce_free(bounce); - close(msgfd); - return; - } + if (iobuf_init(&bounce->iobuf, 0, 0) == -1) + fatal("iobuf_init"); io_init(&bounce->io, fd, bounce, bounce_io, &bounce->iobuf); io_set_timeout(&bounce->io, 30000); io_set_read(&bounce->io); diff --git a/usr.sbin/smtpd/mta_session.c b/usr.sbin/smtpd/mta_session.c index e3cc2158e04..33eea42eb9b 100644 --- a/usr.sbin/smtpd/mta_session.c +++ b/usr.sbin/smtpd/mta_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta_session.c,v 1.20 2012/10/02 12:37:38 chl Exp $ */ +/* $OpenBSD: mta_session.c,v 1.21 2012/10/03 16:43:19 chl Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -357,12 +357,8 @@ mta_enter_state(struct mta_session *s, int newstate) else sa_set_port(sa, 25); - if (iobuf_init(&s->iobuf, 0, 0) == -1) { - log_debug("mta: %p: iobuf_init()", s); - TAILQ_REMOVE(&s->hosts, host, entry); - free(host); - continue; - } + if (iobuf_init(&s->iobuf, 0, 0) == -1) + fatal("iobuf_init"); io_init(&s->io, -1, s, mta_io, &s->iobuf); io_set_timeout(&s->io, 10000); if (io_connect(&s->io, sa) == -1) { diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c index c1e1cf3c3cd..12107f81e59 100644 --- a/usr.sbin/smtpd/smtp.c +++ b/usr.sbin/smtpd/smtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp.c,v 1.118 2012/10/02 12:37:38 chl Exp $ */ +/* $OpenBSD: smtp.c,v 1.119 2012/10/03 16:43:19 chl Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -508,10 +508,8 @@ smtp_new(struct listener *l) s->s_l = l; strlcpy(s->s_msg.tag, l->tag, sizeof(s->s_msg.tag)); - if (iobuf_init(&s->s_iobuf, MAX_LINE_SIZE, MAX_LINE_SIZE) == -1) { - free(s); - return (NULL); - } + if (iobuf_init(&s->s_iobuf, MAX_LINE_SIZE, MAX_LINE_SIZE) == -1) + fatal("iobuf_init"); io_init(&s->s_io, -1, s, session_io, &s->s_iobuf); s->s_state = S_CONNECTED; |