Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/rtadvd test malloc failure. From: Chad Loder <clod...



details:   https://anonhg.NetBSD.org/src/rev/79f3f701b1d9
branches:  trunk
changeset: 533909:79f3f701b1d9
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Jul 10 21:13:35 2002 +0000

description:
test malloc failure.  From: Chad Loder <cloder%acm.org@localhost>.  sync w/kame

diffstat:

 usr.sbin/rtadvd/config.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r e44ac8fab3f3 -r 79f3f701b1d9 usr.sbin/rtadvd/config.c
--- a/usr.sbin/rtadvd/config.c  Wed Jul 10 21:11:43 2002 +0000
+++ b/usr.sbin/rtadvd/config.c  Wed Jul 10 21:13:35 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: config.c,v 1.18 2002/07/10 21:11:43 itojun Exp $       */
+/*     $NetBSD: config.c,v 1.19 2002/07/10 21:13:35 itojun Exp $       */
 /*     $KAME: config.c,v 1.62 2002/05/29 10:13:10 itojun Exp $ */
 
 /*
@@ -109,6 +109,11 @@
        }
 
        tmp = (struct rainfo *)malloc(sizeof(*ralist));
+       if (tmp == NULL) {
+               syslog(LOG_INFO, "<%s> %s: can't allocate enough memory",
+                   __func__, intface);
+               exit(1);
+       }
        memset(tmp, 0, sizeof(*tmp));
        tmp->prefix.next = tmp->prefix.prev = &tmp->prefix;
 



Home | Main Index | Thread Index | Old Index