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")

Details

Provenance
kpAuthored on May 24 2021, 6:32 AM
Parents
rG3fdd5c1e49cb: DRIVER_MODULE(9): Correct the SYNOPSIS of EARLY_DRIVER_MODULE()
Branches
Unknown
Tags
Unknown