]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libpfctl: fix memory leak
authorKristof Provost <kp@FreeBSD.org>
Thu, 27 May 2021 09:28:36 +0000 (11:28 +0200)
committerKristof Provost <kp@FreeBSD.org>
Mon, 31 May 2021 12:18:32 +0000 (14:18 +0200)
commit6dbb729d35d59cc8bc8451bd56f220f9c35a43f3
tree3606c4cd39aedbd40a1d91893c12acab03e5ba1d
parentac1d7397bf33acf8955fc0871ff124550bf50d1f
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
lib/libpfctl/libpfctl.c