diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2016-05-16 19:25:06 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2016-05-16 19:25:06 +0000 |
commit | ad9e01054310fa109d342f7565eba91eef3afd94 (patch) | |
tree | 470382a775b8e7238afc5aee7d29a5aeda8936da /usr.sbin/smtpd/filter.c | |
parent | f8b1c9c32f2a1c6aac2a5a171fa76a7f481da963 (diff) |
fix logic in error code path of smtp state machine that can lead to an
invalid state ending in fatal(), while at it plug a file pointer leak.
ok eric@, millert@
Diffstat (limited to 'usr.sbin/smtpd/filter.c')
-rw-r--r-- | usr.sbin/smtpd/filter.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/filter.c b/usr.sbin/smtpd/filter.c index c927e855046..bc880ee4cf1 100644 --- a/usr.sbin/smtpd/filter.c +++ b/usr.sbin/smtpd/filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filter.c,v 1.17 2016/03/25 15:06:58 krw Exp $ */ +/* $OpenBSD: filter.c,v 1.18 2016/05/16 19:25:05 gilles Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@poolp.org> @@ -297,6 +297,8 @@ filter_event(uint64_t id, int event) if (event == EVENT_DISCONNECT) { io_clear(&s->iev); iobuf_clear(&s->ibuf); + if (s->ofile) + fclose(s->ofile); free(s); } } |