mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 17:12:52 -10:00
pf: fix memory leak on rule add parse failure
Reported by: Igor Ostapenko <[email protected]> Reviewed by: Igor Ostapenko <[email protected]> Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
1 parent
8ccd0b876e
commit
e249f5daa4
1 file changed
+3
-1
@@ -625,8 +625,10 @@ pf_handle_addrule(struct nlmsghdr *hdr, struct nl_pstate *npt)
|
||||
attrs.rule = pf_krule_alloc();
|
||||
|
||||
error = nl_parse_nlmsg(hdr, &addrule_parser, npt, &attrs);
|
||||
if (error != 0)
|
||||
if (error != 0) {
|
||||
pf_free_rule(attrs.rule);
|
||||
return (error);
|
||||
}
|
||||
|
||||
error = pf_ioctl_addrule(attrs.rule, attrs.ticket, attrs.pool_ticket,
|
||||
attrs.anchor, attrs.anchor_call, nlp_get_cred(npt->nlp)->cr_uid,
|
||||
|
||||
Reference in new issue
Block a user