]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pf: Fix more ioctl memory leaks
authorKristof Provost <kp@FreeBSD.org>
Tue, 1 Jun 2021 14:05:47 +0000 (16:05 +0200)
committerKristof Provost <kp@FreeBSD.org>
Tue, 1 Jun 2021 20:41:20 +0000 (22:41 +0200)
commit0f86492b09ca82042166a41f6f21b2dbe4f4a464
tree7413ad8d4f24fbdb4686480367c8b9a81f37733e
parent3df4c387d2e3ca4c2391fb837540b048f60a11c2
pf: Fix more ioctl memory leaks

We must also remember to free nvlists added to a parent nvlist with
nvlist_append_nvlist_array().

More importantly, when nvlist_pack() allocates memory for us it does so
in the M_NVLIST zone, so we must free it with free(.., M_NVLIST). Using
free(.., M_TEMP) as we did silently failed to free the memory.

MFC after: 3 days
Reported by: kib@
Tested by: kib@
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30595
sys/netpfil/pf/pf_ioctl.c
sys/netpfil/pf/pf_nv.c