From f844e6fb6f96ced346c6f87904b225e6a45c7727 Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Thu, 11 Aug 2005 03:19:39 +0000 Subject: [PATCH] Only use variable if malloc succeeded. --- sys/netinet6/raw_ip6.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index e485f1957c..29a9c7ec94 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netinet6/raw_ip6.c,v 1.7.2.7 2003/01/24 05:11:35 sam Exp $ - * $DragonFly: src/sys/netinet6/raw_ip6.c,v 1.19 2005/06/03 19:56:08 eirikn Exp $ + * $DragonFly: src/sys/netinet6/raw_ip6.c,v 1.20 2005/08/11 03:19:39 corecode Exp $ */ /* @@ -567,7 +567,8 @@ rip6_attach(struct socket *so, int proto, struct pru_attach_info *ai) inp->in6p_cksum = -1; MALLOC(inp->in6p_icmp6filt, struct icmp6_filter *, sizeof(struct icmp6_filter), M_PCB, M_NOWAIT); - ICMP6_FILTER_SETPASSALL(inp->in6p_icmp6filt); + if (inp->in6p_icmp6filt != NULL) + ICMP6_FILTER_SETPASSALL(inp->in6p_icmp6filt); return 0; } -- 2.41.0