Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/mail.local die if strdup fails



details:   https://anonhg.NetBSD.org/src/rev/4d5acfeee8da
branches:  trunk
changeset: 539403:4d5acfeee8da
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sat Nov 16 15:41:17 2002 +0000

description:
die if strdup fails

diffstat:

 libexec/mail.local/mail.local.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 894b12459bc5 -r 4d5acfeee8da libexec/mail.local/mail.local.c
--- a/libexec/mail.local/mail.local.c   Sat Nov 16 14:25:10 2002 +0000
+++ b/libexec/mail.local/mail.local.c   Sat Nov 16 15:41:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mail.local.c,v 1.20 2002/05/26 00:02:08 wiz Exp $      */
+/*     $NetBSD: mail.local.c,v 1.21 2002/11/16 15:41:17 itojun Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)mail.local.c       8.22 (Berkeley) 6/21/95";
 #else
-__RCSID("$NetBSD: mail.local.c,v 1.20 2002/05/26 00:02:08 wiz Exp $");
+__RCSID("$NetBSD: mail.local.c,v 1.21 2002/11/16 15:41:17 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -140,6 +140,8 @@
        char *tn, line[2048];
 
        tn = strdup(_PATH_LOCTMP);
+       if (!tn)
+               err(FATAL, "not enough core");
        if ((fd = mkstemp(tn)) == -1 || !(fp = fdopen(fd, "w+")))
                err(FATAL, "unable to open temporary file");
        (void)unlink(tn);



Home | Main Index | Thread Index | Old Index