From nobody Wed Jul 2 08:27:17 2025 X-Original-To: dev-commits-src-all@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 4bXCgT6S5tz604dp; Wed, 02 Jul 2025 08:27:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bXCgT3mMQz3ZSH; Wed, 02 Jul 2025 08:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751444837; 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=LX5ggjcVnaegE88UlVz+VnBBJqqUotX/7hgU60bR2Ws=; b=E6VyHoprHbe+i3HPE5H+m/o/ZrVo3SvnY/Ta0VUHVNzJbeUO5aXPbYaRBPrc4HcWb1psze KXQYWMB8zucpLfzJms7SzUnbPq6cZo2Da2LsR01/s531SYUJDpJZorsfxQu1xEyQqheMFG eZDbXmqkOlagS84/SOCWtOPSAGPf47EUb9voC/8MMlegEh0AHA1tC7Cnvfzx7rEXpV9XPs DnY+GZI0wWsMlmDio+28Z1lQxK22X7v9VFWgNAG/ihnFH7yv5T94hCypFvHLX4vRLY98C9 Q6TauBtPxQfUS8j2zpjVepfQPn5GmlKE1AQOZMYnf2/D4Ta5UV81d4pRDkqgeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751444837; 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=LX5ggjcVnaegE88UlVz+VnBBJqqUotX/7hgU60bR2Ws=; b=WK/e1rI3D85brnCFJTIx2nPtN3bIpuuDMlnrqWdRqBp7dGdCJw9b0PqhSLef9phxU2WhHa riOkPrtjtcZywz0H7RhgW/YOOvBRkMFi3jY95jNQ0easbB8AIB/CurtfU9dFkbQUuweL6d w68kH2RqdeKGqEYw715BDynsQ003DVWoiLXzo//x+61pNZv7LAKN0UyfDb6SGerN76cDHA S8M4THMynDeCZt1DsWQ41llagA7jaXZwoQLZflBuWOT04vCLnXfeSeNQrVY4ywxVbRnTYu QNljvp1T+hB4TVdVa8iay8WPwuTurAYS8iYlnpWmpMCHmTr+dQhP78Js2SLLgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751444837; a=rsa-sha256; cv=none; b=yuxRnWNwExKK1x164MWaJt9dvrJfBMmB6/dF+F9jenjEi2hMEw2z8GR/Ual3ztTHVY8mpJ 1oAj+wkEruOTyIVCR0AMzXulWnSF28jVexXlv1Oy5yGGXJNV6A7uJ46gLOrwZ13EWZS4Q9 XkzLrvhCKHWroqdu3BQ/0k399bVjMxgkFsO0wcc4LLOd1TiESJDo/nSuYXzLaVCERLnKP5 xKH7hkzanhr5CedkfXccItOqMrwCR3+ZbtwyZjR48Sj35tmu8TW6Ud/LoMwmX9hfJlgToK UKAa8KbDLk9j7/5vFvg1Tr7/ggpxYNY3bvhw8UwTzFCdD+y+llP5yBg1RP/h8g== 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 4bXCgT3N3cz1BVM; Wed, 02 Jul 2025 08:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5628RHAB025688; Wed, 2 Jul 2025 08:27:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5628RHoE025685; Wed, 2 Jul 2025 08:27:17 GMT (envelope-from git) Date: Wed, 2 Jul 2025 08:27:17 GMT Message-Id: <202507020827.5628RHoE025685@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: 5c9b1c7e5f27 - main - pfctl: Allocate path only when needed, use __func__ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 5c9b1c7e5f271a18ed07b595240b487509bdcac3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5c9b1c7e5f271a18ed07b595240b487509bdcac3 commit 5c9b1c7e5f271a18ed07b595240b487509bdcac3 Author: Kristof Provost AuthorDate: 2025-06-27 14:25:53 +0000 Commit: Kristof Provost CommitDate: 2025-07-02 07:40:54 +0000 pfctl: Allocate path only when needed, use __func__ Obtained from: OpenBSD, kn , e56235b48a Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 79076fc69776..21befd3ca697 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3192,8 +3192,6 @@ main(int argc, char *argv[]) if (loadopt == 0) loadopt = ~0; - if ((path = calloc(1, MAXPATHLEN)) == NULL) - errx(1, "pfctl: calloc"); memset(anchorname, 0, sizeof(anchorname)); if (anchoropt != NULL) { int len = strlen(anchoropt); @@ -3247,6 +3245,9 @@ main(int argc, char *argv[]) if (pfctl_disable(dev, opts)) error = 1; + if ((path = calloc(1, MAXPATHLEN)) == NULL) + errx(1, "%s: calloc", __func__); + if (showopt != NULL) { switch (*showopt) { case 'A':