git: 48c519be0e80 - main - libpfctl: Don't pass stack garbage to free.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Mar 2023 19:35:46 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=48c519be0e8005aedc817b1bc1101ad32b67a67a commit 48c519be0e8005aedc817b1bc1101ad32b67a67a Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2023-03-22 19:33:59 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2023-03-22 19:33:59 +0000 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 --- lib/libpfctl/libpfctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index f95f79024bf5..f34f83cfb57c 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -1188,7 +1188,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; @@ -1211,7 +1210,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); }