From nobody Sat Sep 9 11:51:16 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RjWXN5wpgz4sGTW; Sat, 9 Sep 2023 11:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RjWXN5Nzlz4PVm; Sat, 9 Sep 2023 11:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694260276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9wVPSJMkE+LhPGcLVnmYIgrLvM+lYn2vZONKwurbyCA=; b=LZvMTt7vOJdbVnePdbEjITMN9Ch8NOjKAELh1K1+0S4cVcioktnb8fmDavMnVlxKvPTY+a 65nBMHh6tiaBrVlAFNLZvvGlKoBjC2IQcK+PXXsbkBmBzrg0j6jFxJEER6NBnvM2GVWjAj B/ZZcVbXitChRcpdR2dnIWgKOkLt0N2J/L+8Yx5rzidEe5I1cjaTZapMAivj3g0MWr7hBh ccy7NXJSUSkiIRQGKv6DMJZfR7VB0JSOypPpxN+0j5M8uiGtO+mCQ2x+CbpYNW2+N0qi5v 6AFD9qkGiMdja4T3+DW5tiCp9qp9q0eZum5r3VDhlna5Jhyh8QgSlV+tWNhi8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694260276; a=rsa-sha256; cv=none; b=oiSL0SeDqCnr14z1jNyGeBsVccpk6pNScNRCc9QQnJ1AEhG3UjxPYrnCzABgYIo15KipgV 3uBykKcuYTuWMtv4yusXhUpeu9SkWf7NT17zGearqZBbFwGub+NfjKo6ZMAgi3Z5twNnNl 1QyuTRW+4qSf0Zaf9JfLS5zOjyTpTTRbVEi863aORugi47KGjGJOvxuCHG9p1uEQ0XmXH2 fUJOL6yjL7YEkewDEpkLmNuBgCwjjB7g/YI9mEBipFU+TFJR20ek13+87BIc+KL76K/uoa yMspcr19lI3jjO8AdUDx0fC4PO7v54PFKEMXq1kCQMr11BVvGib+3wr7QS53Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694260276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9wVPSJMkE+LhPGcLVnmYIgrLvM+lYn2vZONKwurbyCA=; b=ZL1fFpaAoNV78FBVmob+qE32vQIVdn79lNBAKeZT2uXmGjh+nP+NfkbWYrQnGu/vstHJBq tHMPPQkD54shUR2dFDWsV/DnF+v7qk7B8WHj6FxUVqRoR1mh4n2qhbRB2Rh4P4SeKelrIR KjIJe4c7czB+MHLuuFLbo9uPJLCBYuQud2Y0MWYkAhVfE8FA9gsAC9tAKdgFb61xpNtEuQ DQtfM2ghnshbf/Q1oti8M9grrARPSqMZP3JtV5yKsWXpMaSCRodWJ1PqKcZjHZYb9SeL5Y KdGxKl5pnIIra8+8G4LmurYOTMp5U52PHqgpAvW6nttYb4C5qnUfwC9tSTp/0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RjWXN4M5fz7wZ; Sat, 9 Sep 2023 11:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 389BpGbL099736; Sat, 9 Sep 2023 11:51:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 389BpG2E099733; Sat, 9 Sep 2023 11:51:16 GMT (envelope-from git) Date: Sat, 9 Sep 2023 11:51:16 GMT Message-Id: <202309091151.389BpG2E099733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: be47dc1f7132 - stable/14 - libpfctl: allow pfctl_free_status(NULL) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: be47dc1f713217358f882794a85361206f562109 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=be47dc1f713217358f882794a85361206f562109 commit be47dc1f713217358f882794a85361206f562109 Author: Kristof Provost AuthorDate: 2023-08-29 15:02:34 +0000 Commit: Kristof Provost CommitDate: 2023-09-09 09:05:50 +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 f98b43f62cda..7d79d0abb970 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -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);