From owner-svn-src-all@freebsd.org Thu Mar 8 17:14:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB71F44F2A; Thu, 8 Mar 2018 17:14:16 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 607D586624; Thu, 8 Mar 2018 17:14:16 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B4DA13C03; Thu, 8 Mar 2018 17:14:16 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28HEG0c057136; Thu, 8 Mar 2018 17:14:16 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28HEGXS057135; Thu, 8 Mar 2018 17:14:16 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201803081714.w28HEGXS057135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 8 Mar 2018 17:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330664 - stable/10/usr.sbin/syslogd X-SVN-Group: stable-10 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/10/usr.sbin/syslogd X-SVN-Commit-Revision: 330664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2018 17:14:16 -0000 Author: dab Date: Thu Mar 8 17:14:16 2018 New Revision: 330664 URL: https://svnweb.freebsd.org/changeset/base/330664 Log: MFC r330034 Fix a memory leak in syslogd A memory leak in syslogd for processing of forward actions was reported. This modification adapts the patch submitted with that bug to fix the leak. PR: 198385 Submitted by: Sreeram Reported by: Sreeram Sponsored by: Dell EMC Modified: stable/10/usr.sbin/syslogd/syslogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/10/usr.sbin/syslogd/syslogd.c Thu Mar 8 17:04:36 2018 (r330663) +++ stable/10/usr.sbin/syslogd/syslogd.c Thu Mar 8 17:14:16 2018 (r330664) @@ -161,7 +161,7 @@ STAILQ_HEAD(, funix) funixes = { &funix_default, * This structure represents the files that will have log * copies printed. * We require f_file to be valid if f_type is F_FILE, F_CONSOLE, F_TTY - * or if f_type if F_PIPE and f_pid > 0. + * or if f_type is F_PIPE and f_pid > 0. */ struct filed { @@ -353,10 +353,16 @@ close_filed(struct filed *f) return; switch (f->f_type) { + case F_FORW: + if (f->f_un.f_forw.f_addr) { + freeaddrinfo(f->f_un.f_forw.f_addr); + f->f_un.f_forw.f_addr = NULL; + } + /*FALLTHROUGH*/ + case F_FILE: case F_TTY: case F_CONSOLE: - case F_FORW: f->f_type = F_UNUSED; break; case F_PIPE: