From 495a22b595e867d57b26eb154ffb6a509ad13f1f Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 1 Oct 2014 13:35:41 +0000 Subject: [PATCH] Use rn_detachhead() instead of direct free(9) for radix tables. Sponsored by: Nginx, Inc. --- sys/netpfil/pf/pf_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index d88a761eb648..9c5ee320234b 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -1855,11 +1855,11 @@ pfr_destroy_ktable(struct pfr_ktable *kt, int flushaddr) } if (kt->pfrkt_ip4 != NULL) { RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip4); - free((caddr_t)kt->pfrkt_ip4, M_RTABLE); + rn_detachhead((void **)&kt->pfrkt_ip4); } if (kt->pfrkt_ip6 != NULL) { RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip6); - free((caddr_t)kt->pfrkt_ip6, M_RTABLE); + rn_detachhead((void **)&kt->pfrkt_ip6); } if (kt->pfrkt_shadow != NULL) pfr_destroy_ktable(kt->pfrkt_shadow, flushaddr);