HomeFreeBSD

pf: fix ioctl() memory leak

Description

pf: fix ioctl() memory leak

When we create an nvlist and insert it into another nvlist we must
remember to destroy it. The nvlist_add_nvlist() function makes a copy,
just like nvlist_add_string() makes a copy of the string. If we don't
we're leaking memory on every (nvlist-based) ioctl() call.

While here remove two redundant 'break' statements.

PR: 255971
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 4483fb47735c29408c72045469c9c4b3e549668b)

Details

Provenance
kpAuthored on May 24 2021, 6:32 AM
Parents
rG2f0a80794895: pfctl tests: Test fairq configuration
Branches
Unknown
Tags
Unknown