pf: fix double free if pf_ioctl_addrule() fails
authorKristof Provost <kp@FreeBSD.org>
Wed, 8 Nov 2023 14:06:15 +0000 (15:06 +0100)
committerKristof Provost <kp@FreeBSD.org>
Wed, 8 Nov 2023 20:58:52 +0000 (21:58 +0100)
commita6246a50b63450d0fe34e3429807bd5aba8cc2ac
tree5cdc610dc16a425532ce23dbf047c510d1275159
parent85247ee6a2ba1c2dd0053e9be9055efa4be1438e
pf: fix double free if pf_ioctl_addrule() fails

If pf_ioctl_addrule() returns an error it will have freed the rule
itself. There's no need for the caller to free it again.

PR: 274915
Reported by: Dave Cottlehuber <dch@FreeBSD.org>
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
sys/netpfil/pf/pf_nl.c