diff options
author | Todd T. Fries <todd@cvs.openbsd.org> | 2002-07-10 18:08:12 +0000 |
---|---|---|
committer | Todd T. Fries <todd@cvs.openbsd.org> | 2002-07-10 18:08:12 +0000 |
commit | 8ba981815f7ff5bbc206c0a0ea4bfd5eec2dd742 (patch) | |
tree | ffddd8e812862f086020f0eb595a5a1908dc2748 /usr.sbin/rtadvd | |
parent | fb71f97d05f7f799ae61420a2fa5ebc2a21746d3 (diff) |
check malloc return; from Chad Loder <cloder@acm.org>
ok me, henning@
Diffstat (limited to 'usr.sbin/rtadvd')
-rw-r--r-- | usr.sbin/rtadvd/config.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c index a49990dc215..e70d20f29a8 100644 --- a/usr.sbin/rtadvd/config.c +++ b/usr.sbin/rtadvd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.19 2002/06/15 02:52:10 itojun Exp $ */ +/* $OpenBSD: config.c,v 1.20 2002/07/10 18:08:11 todd Exp $ */ /* $KAME: config.c,v 1.62 2002/05/29 10:13:10 itojun Exp $ */ /* @@ -109,6 +109,12 @@ getconfig(intface) } tmp = (struct rainfo *)malloc(sizeof(*ralist)); + if (tmp == NULL) { + syslog(LOG_ERR, "<%s>(%s) can't allocate enough memory", +__func__, intface); + exit(1); + } + memset(tmp, 0, sizeof(*tmp)); tmp->prefix.next = tmp->prefix.prev = &tmp->prefix; |