From 4bac83aa0cc3041760ddcad30b9c10591a771db9 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Wed, 23 Apr 1997 22:40:19 +0000 Subject: [PATCH] Even better fix: use close(fileno(mfp)); to close unneded descriptor and not clobber memory by fclose(). --- usr.bin/vacation/vacation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c index 49fc61939e74..6cfdfc85a606 100644 --- a/usr.bin/vacation/vacation.c +++ b/usr.bin/vacation/vacation.c @@ -40,7 +40,7 @@ static char copyright[] = #ifndef lint static char sccsid[] = "From: @(#)vacation.c 8.2 (Berkeley) 1/26/94"; static char rcsid[] = - "$Id: vacation.c,v 1.7 1997/04/23 22:25:20 ache Exp $"; + "$Id: vacation.c,v 1.8 1997/04/23 22:36:51 ache Exp $"; #endif /* not lint */ /* @@ -424,6 +424,7 @@ sendmessage(myname) dup2(pvect[0], 0); close(pvect[0]); close(pvect[1]); + close(fileno(mfp)); execl(_PATH_SENDMAIL, "sendmail", "-f", myname, from, NULL); syslog(LOG_ERR, "vacation: can't exec %s: %s", _PATH_SENDMAIL, strerror(errno));