diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-02-25 09:30:59 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-02-25 09:30:59 +0000 |
commit | 756497807f96a7dcfc765ab962e4c506d4264265 (patch) | |
tree | 9da7ac37b28fec051e32e146dd859381afdb64ac /usr.sbin | |
parent | f614763f8e8aa5c8515677c0a24f3c568b021d11 (diff) |
NULL pointer dereference
spotted by Matthew Haub <matthew.haub@alumni.adelaide.edu.au>
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/control.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/control.c b/usr.sbin/smtpd/control.c index ccc7a5155b8..cb89d1759c4 100644 --- a/usr.sbin/smtpd/control.c +++ b/usr.sbin/smtpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.16 2009/02/24 12:07:47 gilles Exp $ */ +/* $OpenBSD: control.c,v 1.17 2009/02/25 09:30:58 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -255,8 +255,10 @@ control_close(int fd) { struct ctl_conn *c; - if ((c = control_connbyfd(fd)) == NULL) + if ((c = control_connbyfd(fd)) == NULL) { log_warn("control_close: fd %d: not found", fd); + return; + } msgbuf_clear(&c->ibuf.w); TAILQ_REMOVE(&ctl_conns, c, entry); |