summaryrefslogtreecommitdiff
path: root/sys/netinet/igmp.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-06-19 17:58:50 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-06-19 17:58:50 +0000
commita0d4cb32dbf3ce6e2df43a7af22e64c7658d824f (patch)
treedb224d830e58d5c7024be3637ffc1772b8f69185 /sys/netinet/igmp.c
parent43476ea34bfa2f2287acc0bb5bf4aa9d305ecc03 (diff)
When dealing with mbuf pointers passed down as function parameters,
bugs could easily result in use-after-free or double free. Introduce m_freemp() which automatically resets the pointer before freeing it. So we have less dangling pointers in the kernel. OK krw@ mpi@ claudio@
Diffstat (limited to 'sys/netinet/igmp.c')
-rw-r--r--sys/netinet/igmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index ed7bba46a7d..b4b23884d47 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: igmp.c,v 1.68 2017/05/16 12:24:01 mpi Exp $ */
+/* $OpenBSD: igmp.c,v 1.69 2017/06/19 17:58:49 bluhm Exp $ */
/* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */
/*
@@ -217,7 +217,7 @@ igmp_input(struct mbuf **mp, int *offp, int proto, int af)
ifp = if_get((*mp)->m_pkthdr.ph_ifidx);
if (ifp == NULL) {
- m_freem(*mp);
+ m_freemp(mp);
return IPPROTO_DONE;
}