Use rn_detachhead() instead of direct free(9) for radix tables.

Sponsored by:	Nginx, Inc.
This commit is contained in:
Gleb Smirnoff 2014-10-01 13:35:41 +00:00
parent 3dde11c478
commit 495a22b595

View File

@ -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);