summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2005-07-20 17:06:30 +0000
committerhenning <henning@openbsd.org>2005-07-20 17:06:30 +0000
commitef668455e49cbbf1e822b78dedaf2d343c609c57 (patch)
treea29640d1d1984a82e300ac5f3705e3f9d1a5f176 /sys
parentTypo in kern.nchstats sysctl names. (diff)
downloadwireguard-openbsd-ef668455e49cbbf1e822b78dedaf2d343c609c57.tar.xz
wireguard-openbsd-ef668455e49cbbf1e822b78dedaf2d343c609c57.zip
need to reset kif->pfik_group to NULL before calling pfi_kif_unref() so it can
notice that this kif is not referenced and not attached to an interface or a group and actually deletes it. plugs a memleak, PR 4267 is caused by this.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf_if.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c
index 9638b1a29d0..01201b4b705 100644
--- a/sys/net/pf_if.c
+++ b/sys/net/pf_if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_if.c,v 1.39 2005/06/06 03:44:21 henning Exp $ */
+/* $OpenBSD: pf_if.c,v 1.40 2005/07/20 17:06:30 henning Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
@@ -119,7 +119,6 @@ pfi_kif_get(const char *kif_name)
TAILQ_INIT(&kif->pfik_dynaddrs);
RB_INSERT(pfi_ifhead, &pfi_ifs, kif);
-
return (kif);
}
@@ -272,9 +271,9 @@ pfi_detach_ifgroup(struct ifg_group *ifg)
s = splsoftnet();
pfi_update++;
- pfi_kif_unref(kif, PFI_KIF_REF_NONE);
kif->pfik_group = NULL;
ifg->ifg_pf_kif = NULL;
+ pfi_kif_unref(kif, PFI_KIF_REF_NONE);
splx(s);
}