From nobody Sat Nov 30 18:52:42 2024 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 4Y0zgt500Lz5fThl; Sat, 30 Nov 2024 18:52:42 +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 4Y0zgt4P5xz4DCf; Sat, 30 Nov 2024 18:52:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732992762; 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=Do7UagTfXOHxTe51paX3DTAHfK76x/rC4OmvG4YeSGM=; b=mzUsjUvKGjbM3bZN3K8/P1pE2EFJdIvStBRHnc/GYgflp0b+unZZg/9PGyovDm3cm0SBlc UIqXO64kWv5i1Oze/+A3r4hh9p10wI0mW5+XbJw1SueszU5xnIct9IJ69JRbUPWqyydlFq OdXDCRSJdFAdXIXajV64Hf47+s0Zo5VHqJdkozQ1Qi2QtynNbzmaIyxAOEwNSJxso3Pnlo gj++PmA/Bl+mnelciEfIbYzj9pbw/VLci20MhjxJ+fPG2pbLBdcWY3bmQ4lgYyoopGeoc7 yMhK8ejPmBsFaY2B8Ym9lwJ60H9VSRpYEcfinO15bGXMB5aggMLH7M4sY7xZJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732992762; 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=Do7UagTfXOHxTe51paX3DTAHfK76x/rC4OmvG4YeSGM=; b=YDMraLHDI2fMv9zyPNyQBqyzQbuBgoxZENoQZVAGQ728vEGiMEUWsHjo9CM7hgclr7Oa3S d/TDHXFCKBz4lKwM8ajxFlE2frXmcPVPBstghj2t+fGcQsUcT/PSvXIv5i+ZY4GUjoBuK6 d+ghqN2S6dexWkxW94hbSFUu9QOOyA7Iz2qxG2v47dYH1xKkEy2/DqHkYhxJqwG869EZQe HSZE+vgjquDWbcX+fapsvr6FiIgiQNLxDwFKS+k4qEQYPMf/3B0XAMCFyQRZAgQWj/QBtG uh3crO/O/1c9bHqSleA5H3kCRFbPMTgbJpxeExErk0dzwcGmZlR4KkCBE9PL3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732992762; a=rsa-sha256; cv=none; b=qTnlFz2KD9NsdVFRbWklfPoLlFTSwC2kRrPfo04sX+aYO+zNqTCffuHzVsRUdUydDxI3jE ScqQbNIyFdAfdHswPtKkOeYFDRs9e1U0DeUiQVqfR4HWafcks1WEQRB0exwtRzFQkIRR2i fZSmNlURWojFjcB7+bUOcZXeAm+RtJZlUg+amzCdrcZ81uy/fNdDIdHafHU+1j0BlBN/ot oTWxknmk6Y0orsQi5OS2Fv7bJivh1xPZNqI7SMhBinvyf9PReB/KaqfsAXfKiMdP7xXxG9 i3ElIzBvP4AuCQOuCGMJaiJ6LKMGv+Y9BmuNQejBF4YslY9O16LoaQROv7+sIA== 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 4Y0zgt40JhzL3B; Sat, 30 Nov 2024 18:52:42 +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 4AUIqgd9075795; Sat, 30 Nov 2024 18:52:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AUIqgQ4075792; Sat, 30 Nov 2024 18:52:42 GMT (envelope-from git) Date: Sat, 30 Nov 2024 18:52:42 GMT Message-Id: <202411301852.4AUIqgQ4075792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fe291141486a - main - syslogd: Fix issues reported by gcc 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe291141486acf27ed1c8eed791ba9897f84c3f0 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fe291141486acf27ed1c8eed791ba9897f84c3f0 commit fe291141486acf27ed1c8eed791ba9897f84c3f0 Author: Mark Johnston AuthorDate: 2024-11-29 19:43:42 +0000 Commit: Mark Johnston CommitDate: 2024-11-30 18:52:34 +0000 syslogd: Fix issues reported by gcc - When forwaring a message, don't assume that f->f_num_addr_fds > 0. - Avoid calling free() on a stack-allocated object. Fixes: 4ecbee2760f7 ("syslogd: Open forwarding socket descriptors") Fixes: f4b4a10abb26 ("syslogd: Move selector parsing into its own function") Reviewed by: jfree Differential Revision: https://reviews.freebsd.org/D47844 --- usr.sbin/syslogd/syslogd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 0e063b72beb6..23ef5d78c319 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1795,6 +1795,7 @@ fprintlog_write(struct filed *f, struct iovlist *il, int flags) iovlist_truncate(il, MaxForwardLen); #endif + lsent = 0; for (size_t i = 0; i < f->f_num_addr_fds; ++i) { struct msghdr msg = { .msg_iov = il->iov, @@ -2941,7 +2942,6 @@ parse_selector(const char *p, struct filed *f) pri = decode(buf, prioritynames); if (pri < 0) { dprintf("unknown priority name \"%s\"", buf); - free(f); return (NULL); } } @@ -2965,7 +2965,6 @@ parse_selector(const char *p, struct filed *f) i = decode(buf, facilitynames); if (i < 0) { dprintf("unknown facility name \"%s\"", buf); - free(f); return (NULL); } f->f_pmask[i >> 3] = pri;