summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexandr Nedvedicky <sashan@cvs.openbsd.org>2018-03-28 10:56:19 +0000
committerAlexandr Nedvedicky <sashan@cvs.openbsd.org>2018-03-28 10:56:19 +0000
commitdf2b8b0f026cb3aff865f35fa3ee244f273835b4 (patch)
tree30304de4f0101c174c8c58be763123d774e6d633 /sys
parent126d90d0a1cc687e1831de4d750e2cb6402c7a09 (diff)
- memory leak occurs when adding same table twice.
(tj found fix in FreeBSD repo for us) OK @bluhm, @henning
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf_table.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c
index bc93e8709ac..dc264a2b335 100644
--- a/sys/net/pf_table.c
+++ b/sys/net/pf_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_table.c,v 1.127 2017/08/16 14:19:57 mikeb Exp $ */
+/* $OpenBSD: pf_table.c,v 1.128 2018/03/28 10:56:18 sashan Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
@@ -1305,8 +1305,10 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *nadd, int flags)
if (p == NULL)
senderr(ENOMEM);
SLIST_FOREACH(q, &addq, pfrkt_workq) {
- if (!pfr_ktable_compare(p, q))
+ if (!pfr_ktable_compare(p, q)) {
+ pfr_destroy_ktable(p, 0);
goto _skip;
+ }
}
SLIST_INSERT_HEAD(&addq, p, pfrkt_workq);
xadd++;