diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-16 06:30:57 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-16 06:30:57 +0000 |
commit | 74fb935fb670b9592ea5ab6ea25b1980205945c3 (patch) | |
tree | 60a4f5f6bd890192b81be716f18ce3c72ec44a67 | |
parent | cd68f9fd9f2baef40ae0855f613088ced5134c9a (diff) |
check malloc ret val
-rw-r--r-- | libexec/mail.local/mail.local.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libexec/mail.local/mail.local.c b/libexec/mail.local/mail.local.c index 04311cbe7b4..28386905258 100644 --- a/libexec/mail.local/mail.local.c +++ b/libexec/mail.local/mail.local.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)mail.local.c 5.6 (Berkeley) 6/19/91";*/ -static char rcsid[] = "$Id: mail.local.c,v 1.7 1996/08/30 12:04:13 deraadt Exp $"; +static char rcsid[] = "$Id: mail.local.c,v 1.8 1996/10/16 06:30:56 millert Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -184,7 +184,8 @@ store(from) int fd, eline; char *tn, line[2048]; - tn = strdup(_PATH_LOCTMP); + if ((tn = strdup(_PATH_LOCTMP)) == NULL) + err(FATAL, "unable to allocate memory"); if ((fd = mkstemp(tn)) == -1 || !(fp = fdopen(fd, "w+"))) err(FATAL, "unable to open temporary file"); (void)unlink(tn); |