ok?

Index: net/pf_table.c
===================================================================
RCS file: /cvs/src/sys/net/pf_table.c,v
retrieving revision 1.130
diff -u -p -r1.130 pf_table.c
--- net/pf_table.c      10 Dec 2018 16:48:15 -0000      1.130
+++ net/pf_table.c      21 Jun 2019 20:04:28 -0000
@@ -2051,9 +2051,9 @@ pfr_destroy_ktable(struct pfr_ktable *kt
                pfr_destroy_kentries(&addrq);
        }
        if (kt->pfrkt_ip4 != NULL)
-               free((caddr_t)kt->pfrkt_ip4, M_RTABLE, 0);
+               free(kt->pfrkt_ip4, M_RTABLE, sizeof(*kt->pfrkt_ip4));
        if (kt->pfrkt_ip6 != NULL)
-               free((caddr_t)kt->pfrkt_ip6, M_RTABLE, 0);
+               free(kt->pfrkt_ip6, M_RTABLE, sizeof(*kt->pfrkt_ip6));
        if (kt->pfrkt_shadow != NULL)
                pfr_destroy_ktable(kt->pfrkt_shadow, flushaddr);
        if (kt->pfrkt_rs != NULL) {
Index: net/radix.c
===================================================================
RCS file: /cvs/src/sys/net/radix.c,v
retrieving revision 1.58
diff -u -p -r1.58 radix.c
--- net/radix.c 20 Jun 2017 09:03:39 -0000      1.58
+++ net/radix.c 21 Jun 2019 20:00:44 -0000
@@ -457,7 +457,7 @@ rn_addmask(void *n_arg, int search, int 
        tm = rn_insert(cp, mask_rnhead, &maskduplicated, tm);
        if (maskduplicated) {
                log(LOG_ERR, "%s: mask impossibly already in tree\n", __func__);
-               free(saved_tm, M_RTABLE, 0);
+               free(saved_tm, M_RTABLE, max_keylen + 2 * sizeof (*tm));
                return (tm);
        }
        /*
Index: netinet/ip_spd.c
===================================================================
RCS file: /cvs/src/sys/netinet/ip_spd.c,v
retrieving revision 1.99
diff -u -p -r1.99 ip_spd.c
--- netinet/ip_spd.c    22 Oct 2018 15:32:19 -0000      1.99
+++ netinet/ip_spd.c    21 Jun 2019 19:59:28 -0000
@@ -93,7 +93,8 @@ spd_table_add(unsigned int rtableid)
 
                if (spd_tables != NULL) {
                        memcpy(p, spd_tables, sizeof(*rnh) * (spd_table_max+1));
-                       free(spd_tables, M_RTABLE, 0);
+                       free(spd_tables, M_RTABLE,
+                           sizeof(*rnh) * (spd_table_max+1));
                }
                spd_tables = p;
                spd_table_max = rdomain;

Reply via email to