From nobody Thu Aug 31 08:56:42 2023 X-Original-To: dev-commits-src-main@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 4Rbw57647kz4rw3D; Thu, 31 Aug 2023 08:56:43 +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 4Rbw571N33z4Z7f; Thu, 31 Aug 2023 08:56:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693472203; 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=hciPVbfluMO9V2s2AjasrtlNe23kdCuT0jxehTqlDiI=; b=B/kAJDMOhKBfD7Pv2wpIZyyYyECqEgByH+MQW5hMAcHOzbw2cpfggI/dd25qAMedlNZund UiE28UWUKYuXO7NZJQ9nnKNNQFydbyx4d1a0faZ97WB8nl8l7bpRMo7RA/1eR3RTbbEyXC JErvgQvParuJ7g2AKTdWX1/ygrctQ/eDwl5oaNsxVDUMPhDDfxOemAhbStWHBEYkr6REgZ D/vW3/yDzdu3WUaXj+eCwGVwzz4MuaFh5oFRmFFptlCXZisU+94wY1+3m4YYo/oHpig0x0 oeHj/ZDiwm8pZtanr5D4UGSMuP0oxtNz1MWCfo0d4z7YjW4hhAL4ZVtbeBvDPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693472203; a=rsa-sha256; cv=none; b=BDdMTEEa9m0WBEf2nBVnaPMKgLkiia1MutpDFZjQb5qRhaxzcxojFURRuG1aDnL7y5+cdm SPk8X4CLkD+biUXtw/OFp0TRvRcsxR8H2oZdSvX1PobwnxfUN9fmamFuDGQN5UJp2CcmCi IFZN6leo52nq2KN2oFZylHWYcI0wAtfmF0/wHQwqdGwB1HwOmcWtbN1lE/qtkh7HCi1Mf9 2V5aMIMf5i6GuVXXQv68RB5ahgWsmP26GSsGzfq4KKBjxFVeWFTeDHZOFsIGr5SLMiaMMv azVXkPQEBcc1G9nUPGIxmPABKlfKPTlMXwD1kUdpEscmB5TYnDNfbz6oN4psHw== 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=1693472203; 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=hciPVbfluMO9V2s2AjasrtlNe23kdCuT0jxehTqlDiI=; b=Id/Bx6LpqyLSGAp9uZJ5yLWYIlbRK9iLWEu6Nt9RxfjHFXDHTsKuaD4FKz6wFBX1nRhk8R wdJiS+4Xf5XAHGkZYPxypuqSN4QSfP/iP6BUqtyqQ/wtor8/tcmWDKS+SOPzKxBLIKwmMK 0Wcba4sFBLTxS6kHBDZurnVg8AHxMuP+K4N0MEEJ4b/rmwUFcoxvlxbo8jY9kKwaDqD0+H jlOqzVrfeRzxehBJeHGfeGjgse1P6DOut/jTj2iRpJmbY/8wlnfi0X9JuNYETMsmG1iXLz RT//UWaFml+W4wKMlL+OskRsHfeVP+UV582q2pInSMPazz9iDiZJinkqG9rsLw== 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 4Rbw570MB9z1B2D; Thu, 31 Aug 2023 08:56:43 +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 37V8ugp8083191; Thu, 31 Aug 2023 08:56:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37V8ugn7083188; Thu, 31 Aug 2023 08:56:42 GMT (envelope-from git) Date: Thu, 31 Aug 2023 08:56:42 GMT Message-Id: <202308310856.37V8ugn7083188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0b01878fd00b - main - libpfctl: allow pfctl_free_status(NULL) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0b01878fd00b128ce3dead119b37781048744d39 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0b01878fd00b128ce3dead119b37781048744d39 commit 0b01878fd00b128ce3dead119b37781048744d39 Author: Kristof Provost AuthorDate: 2023-08-29 15:02:34 +0000 Commit: Kristof Provost CommitDate: 2023-08-31 08:56:31 +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 --- 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);