Page MenuHomeFreeBSD

libpfctl: fix memory leak
ClosedPublic

Authored by kp on May 27 2021, 9:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 4, 10:12 AM
Unknown Object (File)
Jan 15 2024, 2:17 PM
Unknown Object (File)
Dec 23 2023, 8:13 PM
Unknown Object (File)
Dec 23 2023, 3:41 PM
Unknown Object (File)
Dec 5 2023, 8:07 AM
Unknown Object (File)
Oct 17 2023, 7:25 PM
Unknown Object (File)
Sep 19 2023, 3:41 PM
Unknown Object (File)
Sep 6 2023, 5:51 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.