From owner-svn-src-head@freebsd.org Mon Mar 20 04:25:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1C8FD0CCA3; Mon, 20 Mar 2017 04:25:41 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id A41431723; Mon, 20 Mar 2017 04:25:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2K4Pe7Q012044; Mon, 20 Mar 2017 04:25:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2K4PeLQ012043; Mon, 20 Mar 2017 04:25:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703200425.v2K4PeLQ012043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 20 Mar 2017 04:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315618 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Mar 2017 04:25:42 -0000 Author: ngie Date: Mon Mar 20 04:25:40 2017 New Revision: 315618 URL: https://svnweb.freebsd.org/changeset/base/315618 Log: syslogd: don't leak `f` on failure in cfline(..) Free `f` if an unknown priority or facility is parsed with the function. MFC after: 1 week Reported by: Coverity CID: 1368068 Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Mon Mar 20 03:52:06 2017 (r315617) +++ head/usr.sbin/syslogd/syslogd.c Mon Mar 20 04:25:40 2017 (r315618) @@ -2117,6 +2117,7 @@ cfline(const char *line, const char *pro (void)snprintf(ebuf, sizeof ebuf, "unknown priority name \"%s\"", buf); logerror(ebuf); + free(f); return (NULL); } } @@ -2147,6 +2148,7 @@ cfline(const char *line, const char *pro "unknown facility name \"%s\"", buf); logerror(ebuf); + free(f); return (NULL); } f->f_pmask[i >> 3] = pri;