From 1faf2f7865ed890ac37927d695b0045b8562d38a Mon Sep 17 00:00:00 2001 From: mikeb Date: Thu, 9 Apr 2015 12:04:14 +0000 Subject: [PATCH] Plug a memory leak in pfr_destroy_kentry pfi_kif objects allocated for table entries created by route-to or by specifying weight weren't garbage collected when the table entry was destroyed. Spotted by Alexandr Nedvedicky , thanks! Ok henning, florian --- sys/net/pf_table.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index 950b73a0a2c..81378621bd9 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.107 2015/04/08 14:19:28 mikeb Exp $ */ +/* $OpenBSD: pf_table.c,v 1.108 2015/04/09 12:04:14 mikeb Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -877,6 +877,9 @@ pfr_destroy_kentry(struct pfr_kentry *ke) { if (ke->pfrke_counters) pool_put(&pfr_kcounters_pl, ke->pfrke_counters); + if (ke->pfrke_type == PFRKE_COST || ke->pfrke_type == PFRKE_ROUTE) + pfi_kif_unref(((struct pfr_kentry_all *)ke)->pfrke_rkif, + PFI_KIF_REF_ROUTE); pool_put(&pfr_kentry_pl[ke->pfrke_type], ke); } -- 2.20.1