diff --git a/sys/netinet/ipfw/ip_dn_glue.c b/sys/netinet/ipfw/ip_dn_glue.c index 69f189c8de4a..c0df1fc04be0 100644 --- a/sys/netinet/ipfw/ip_dn_glue.c +++ b/sys/netinet/ipfw/ip_dn_glue.c @@ -495,7 +495,7 @@ dn_compat_config_profile(struct dn_profile *pf, struct dn_link *p, static int dn_compat_configure(void *v) { - struct dn_id *buf, *base; + struct dn_id *buf = NULL, *base; struct dn_sch *sch = NULL; struct dn_link *p = NULL; struct dn_fs *fs = NULL; @@ -547,6 +547,8 @@ dn_compat_configure(void *v) } error = do_config(base, (char *)buf - (char *)base); + if (buf) + free(buf, M_DUMMYNET); return error; } diff --git a/sys/netinet/ipfw/ip_fw_sockopt.c b/sys/netinet/ipfw/ip_fw_sockopt.c index 9d67dc008695..e25b960e6407 100644 --- a/sys/netinet/ipfw/ip_fw_sockopt.c +++ b/sys/netinet/ipfw/ip_fw_sockopt.c @@ -951,7 +951,7 @@ ipfw_ctl(struct sockopt *sopt) case IP_FW_ADD: rule = malloc(RULE_MAXSIZE, M_TEMP, M_WAITOK); error = sooptcopyin(sopt, rule, RULE_MAXSIZE, - sizeof(struct ip_fw) ); + sizeof(struct ip_fw7) ); /* * If the size of commands equals RULESIZE7 then we assume