libpfctl: memory leak fix

We must remember to free the nvlist we create from the kernel's response
to DIOCGETSTATESNV, on every iteration.

Reviewed by:	donner
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30957

(cherry picked from commit 0e9f1892ec)
This commit is contained in:
Kristof Provost 2021-06-30 13:02:35 +02:00
parent 1882bdd192
commit 4debb6a3a0

View file

@ -727,6 +727,7 @@ pfctl_get_states(int dev, struct pfctl_states *states)
goto out;
}
nvlist_destroy(nvl);
nvl = nvlist_unpack(nv.data, nv.len, 0);
if (nvl == NULL) {
error = EIO;