Date: Thu, 7 Sep 2023 19:24:59 GMT From: Kristof Provost <kp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: c364b43a717a - stable/13 - libpfctl: allow pfctl_free_status(NULL) Message-ID: <202309071924.387JOxv3064613@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c364b43a717a91f53aabde06bf6077bf87069d54 commit c364b43a717a91f53aabde06bf6077bf87069d54 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2023-08-29 15:02:34 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2023-09-07 19:23:07 +0000 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 (cherry picked from commit 0b01878fd00b128ce3dead119b37781048744d39) --- lib/libpfctl/libpfctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 6ade20fcd990..3bfa0698e4b1 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -256,6 +256,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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309071924.387JOxv3064613>