diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-04-27 16:22:18 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-04-27 16:22:18 +0000 |
commit | cf5638994f7716fc70d8cad17faf5f02c0c75e1d (patch) | |
tree | 507ffd0d5b2514b45c4006d2b3281db8fbba3f5e /usr.sbin/smtpd | |
parent | 0ce6ce0c2b3b40eb9d37e1c840d0d203a2c4d453 (diff) |
fix unlikely fd leak; ok gilles@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/smtp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c index bafea923f4f..9e8f84af000 100644 --- a/usr.sbin/smtpd/smtp.c +++ b/usr.sbin/smtpd/smtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp.c,v 1.38 2009/04/24 09:38:11 jacekm Exp $ */ +/* $OpenBSD: smtp.c,v 1.39 2009/04/27 16:22:17 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -373,8 +373,10 @@ smtp_dispatch_queue(int sig, short event, void *p) fd = imsg_get_fd(ibuf, &imsg); - if ((s = session_lookup(env, ss->id)) == NULL) + if ((s = session_lookup(env, ss->id)) == NULL) { + close(fd); break; + } if (fd != -1) { s->datafp = fdopen(fd, "w"); |