diff options
author | 2001-11-17 19:10:25 +0000 | |
---|---|---|
committer | 2001-11-17 19:10:25 +0000 | |
commit | 2cefec3ea66b2904ccc8bb174cefca2921bd5116 (patch) | |
tree | 9cf26af0aceb85b8ac51dc6b992a0be1c2bb87a3 | |
parent | missing prototype (getmsgbufsize). (diff) | |
download | wireguard-openbsd-2cefec3ea66b2904ccc8bb174cefca2921bd5116.tar.xz wireguard-openbsd-2cefec3ea66b2904ccc8bb174cefca2921bd5116.zip |
properly bail out of incfile(); millert ok
-rw-r--r-- | usr.bin/mail/lex.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c index debfeda5d22..ff068f48529 100644 --- a/usr.bin/mail/lex.c +++ b/usr.bin/mail/lex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.c,v 1.23 2001/06/23 23:04:23 millert Exp $ */ +/* $OpenBSD: lex.c,v 1.24 2001/11/17 19:10:25 deraadt Exp $ */ /* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)lex.c 8.2 (Berkeley) 4/20/95"; #else -static char rcsid[] = "$OpenBSD: lex.c,v 1.23 2001/06/23 23:04:23 millert Exp $"; +static char rcsid[] = "$OpenBSD: lex.c,v 1.24 2001/11/17 19:10:25 deraadt Exp $"; #endif #endif /* not lint */ @@ -185,11 +185,15 @@ incfile() if (ibuf == NULL) return(-1); holdsigs(); - if (!spool_lock()) + if (!spool_lock()) { + (void)Fclose(ibuf); + relsesigs(); return(-1); + } newsize = fsize(ibuf); /* make sure mail box has grown and is non-empty */ if (newsize == 0 || newsize <= mailsize) { + (void)Fclose(ibuf); spool_unlock(); relsesigs(); return(newsize == mailsize ? 0 : -1); |