summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl/bgpctl.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-03-11 14:49:09 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-03-11 14:49:09 +0000
commitcae08498bed7ac1de188ecd1301c266036b576e3 (patch)
tree155bcfd255f2585aa074122a00c19b1a6c73afbc /usr.sbin/bgpctl/bgpctl.c
parent4e506a4b62cf0ced8d3ee7d28586f75fbd04cf6a (diff)
check for malloc failure...
Diffstat (limited to 'usr.sbin/bgpctl/bgpctl.c')
-rw-r--r--usr.sbin/bgpctl/bgpctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 6bfb9c76d42..48d4dd786fa 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.44 2004/03/02 20:00:14 henning Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.45 2004/03/11 14:49:08 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -699,7 +699,8 @@ show_rib_summary_msg(struct imsg *imsg)
aspath = NULL;
}
- rib = malloc(imsg->hdr.len - IMSG_HEADER_SIZE);
+ if ((rib = malloc(imsg->hdr.len - IMSG_HEADER_SIZE)) == NULL)
+ err(1, NULL);
memcpy(rib, imsg->data, imsg->hdr.len - IMSG_HEADER_SIZE);
print_prefix(&rib->prefix, rib->prefixlen, rib->flags);