HomeFreeBSD

libpfctl: fix memory leak

Description

libpfctl: fix 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.

See also 4483fb47735c29408c72045469c9c4b3e549668b

Reviewed by: scottl
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30492

(cherry picked from commit 6dbb729d35d59cc8bc8451bd56f220f9c35a43f3)

Details

Provenance
kpAuthored on May 27 2021, 9:28 AM
Reviewer
scottl
Differential Revision
D30492: libpfctl: fix memory leak
Parents
rG7f527ae46b06: nfscl: Revert commit 5a8b2c5a46dffa3828ad16abee36ac4676f741bf
Branches
Unknown
Tags
Unknown