diff options
author | 2018-03-28 10:56:18 +0000 | |
---|---|---|
committer | 2018-03-28 10:56:18 +0000 | |
commit | cc141bdba5f1b74e6135b4ff8e0ba1f9412d6638 (patch) | |
tree | 3a3dbe4f0b0aba5ce89c3a52f9682d9b9731f3e0 | |
parent | Call FREF() right after fd_getfile() in getsock(). (diff) | |
download | wireguard-openbsd-cc141bdba5f1b74e6135b4ff8e0ba1f9412d6638.tar.xz wireguard-openbsd-cc141bdba5f1b74e6135b4ff8e0ba1f9412d6638.zip |
- memory leak occurs when adding same table twice.
(tj found fix in FreeBSD repo for us)
OK @bluhm, @henning
-rw-r--r-- | sys/net/pf_table.c | 6 |
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++; |