Page MenuHomeFreeBSD

libpfctl: fix memory leak
ClosedPublic

Authored by kp on May 27 2021, 9:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 18, 10:13 PM
Unknown Object (File)
Sat, Jan 18, 10:06 PM
Unknown Object (File)
Sat, Jan 11, 6:07 PM
Unknown Object (File)
Fri, Jan 10, 9:50 AM
Unknown Object (File)
Fri, Jan 10, 3:43 AM
Unknown Object (File)
Dec 24 2024, 3:59 AM
Unknown Object (File)
Nov 22 2024, 10:46 AM
Unknown Object (File)
Nov 13 2024, 10:45 PM
Subscribers

Details

Summary

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

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 39493
Build 36382: arc lint + arc unit

Event Timeline

kp requested review of this revision.May 27 2021, 9:48 AM
scottl added a subscriber: scottl.

This looks like a deficiency in the API design, but I don't object to this change.

This revision is now accepted and ready to land.May 28 2021, 7:14 PM

This looks like a deficiency in the API design, but I don't object to this change.

You mean the nvlist API? Not really. This one is on me.
The API is consistent in copying data that's added to an nvlist with nvlist_add_*(). It does it with strings, and it also does it with nvlists. It does make sense, but I'd not thought of that when I originally wrote this code.

This revision was automatically updated to reflect the committed changes.