1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

libpfctl: allow pfctl_free_status(NULL)

Mimic free() and friends, and allow free()ing of NULL.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D41648
This commit is contained in:
Kristof Provost 2023-08-29 17:02:34 +02:00
parent ddd08375c8
commit 0b01878fd0

View File

@ -257,6 +257,9 @@ pfctl_free_status(struct pfctl_status *status)
{
struct pfctl_status_counter *c, *tmp;
if (status == NULL)
return;
TAILQ_FOREACH_SAFE(c, &status->counters, entry, tmp) {
free(c->name);
free(c);