libpfctl: Don't pass stack garbage to free.

GCC 9 on stable/12 reports a -Wmaybe-uninitialized error for the call
to free in _pfctl_clear_states.

Reviewed by:	mjg
Differential Revision:	https://reviews.freebsd.org/D39198

(cherry picked from commit 48c519be0e)
This commit is contained in:
John Baldwin 2023-03-22 12:33:59 -07:00
parent f66e0b086c
commit b086848fc0

View file

@ -922,7 +922,6 @@ static int
_pfctl_clear_states(int dev, const struct pfctl_kill *kill,
unsigned int *killed, uint64_t ioctlval)
{
struct pfioc_nv nv;
nvlist_t *nvl;
int ret;
@ -945,7 +944,6 @@ _pfctl_clear_states(int dev, const struct pfctl_kill *kill,
*killed = nvlist_get_number(nvl, "killed");
nvlist_destroy(nvl);
free(nv.data);
return (ret);
}