summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-11-18 03:23:42 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-11-18 03:23:42 +0000
commit27f8d9d56f47a43296049a35ac401ad842869b4d (patch)
tree6dd92a4548bab23b0649e68742173760d5b2242c /sys/net
parent99b5927713cc150a5a583e2dbb062bfa95e3dc71 (diff)
don't leak the the task struct used for the addrhook in pfi_detach_ifnet.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pf_if.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c
index ba7cff1932a..76bb90b2f91 100644
--- a/sys/net/pf_if.c
+++ b/sys/net/pf_if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_if.c,v 1.98 2019/11/08 07:16:29 dlg Exp $ */
+/* $OpenBSD: pf_if.c,v 1.99 2019/11/18 03:23:41 dlg Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
@@ -264,7 +264,10 @@ pfi_detach_ifnet(struct ifnet *ifp)
pfi_update++;
t = kif->pfik_ah_cookie;
+ kif->pfik_ah_cookie = NULL;
if_addrhook_del(ifp, t);
+ free(t, PFI_MTYPE, sizeof(*t));
+
pfi_kif_update(kif);
kif->pfik_ifp = NULL;