diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-03-13 19:29:45 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-03-13 19:29:45 +0000 |
commit | 6f620dcce54e65952c33ef6d0fbe95d4742dc005 (patch) | |
tree | 4c668ed28a93f4a79150d8324b7de7fb045f8a3c /usr.sbin/popa3d | |
parent | 09e37399417c51ca8ad954bc9ef88b55cea3f438 (diff) |
Missing return value and fd leak in fork()'s error path. Spotted by mpech@
Diffstat (limited to 'usr.sbin/popa3d')
-rw-r--r-- | usr.sbin/popa3d/standalone.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/popa3d/standalone.c b/usr.sbin/popa3d/standalone.c index 43e9d82353e..948c86fc689 100644 --- a/usr.sbin/popa3d/standalone.c +++ b/usr.sbin/popa3d/standalone.c @@ -1,4 +1,4 @@ -/* $OpenBSD: standalone.c,v 1.9 2005/03/12 22:17:35 cloder Exp $ */ +/* $OpenBSD: standalone.c,v 1.10 2005/03/13 19:29:44 otto Exp $ */ /* * Standalone POP server: accepts connections, checks the anti-flood limits, @@ -302,7 +302,8 @@ handle(int sock) switch ((pid = fork())) { case -1: syslog(SYSLOG_PRI_ERROR, "%s: fork: %m", hbuf); - break; + close(new); + return -1; case 0: #if DAEMON_LIBWRAP |