diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-06-19 17:58:50 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-06-19 17:58:50 +0000 |
commit | a0d4cb32dbf3ce6e2df43a7af22e64c7658d824f (patch) | |
tree | db224d830e58d5c7024be3637ffc1772b8f69185 /sys/netinet/igmp.c | |
parent | 43476ea34bfa2f2287acc0bb5bf4aa9d305ecc03 (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.c | 4 |
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; } |