aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-07-23 15:01:29 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-08-11 13:37:52 +0000
commit67ed59f6a8261e6cbb82554c72e59ae81afb0b36 (patch)
tree04fb96080bccaacb81ed33748940465deea59288
parent53551e9976b9bfcff71ca820aefc22d7a668214e (diff)
pf: consistently malloc rules with M_ZERO
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 49a7d47235434a300cc57b205e493988fdebf79c)
-rw-r--r--sys/netpfil/pf/pf_ioctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index edc786d804da..d3d0ede278fd 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -2359,7 +2359,7 @@ DIOCADDRULENV_error:
struct pfioc_rule *pr = (struct pfioc_rule *)addr;
struct pf_krule *rule;
- rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK);
+ rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK | M_ZERO);
error = pf_rule_to_krule(&pr->rule, rule);
if (error != 0) {
free(rule, M_PFRULE);
@@ -2616,7 +2616,7 @@ DIOCGETRULENV_error:
}
if (pcr->action != PF_CHANGE_REMOVE) {
- newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK);
+ newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK | M_ZERO);
error = pf_rule_to_krule(&pcr->rule, newrule);
if (error != 0) {
free(newrule, M_PFRULE);