From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7117F139695 for ; Tue, 30 May 2017 21:25:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D15F021C090; Tue, 30 May 2017 21:25:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B215021C090 for ; Tue, 30 May 2017 21:25:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AD60E341714 for ; Tue, 30 May 2017 21:25:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 744317468 for ; Tue, 30 May 2017 21:25:05 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1496130475.7185e242ffaa8cd1b672fe4726502a196fd779c2.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/rc-logger.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 7185e242ffaa8cd1b672fe4726502a196fd779c2 X-VCS-Branch: master Date: Tue, 30 May 2017 21:25:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 14266608-ebfd-450d-8a66-1dde61580f1f X-Archives-Hash: 024ae94ef0ca72bc14e785040fa4c925 commit: 7185e242ffaa8cd1b672fe4726502a196fd779c2 Author: Sergei Trofimovich inbox ru> AuthorDate: Tue May 30 07:47:55 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Tue May 30 07:47:55 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=7185e242 rc-logger.c: fix crash on fclose(NULL) (#137) Only close the log if we successfully opened it. Reported-by: Brian Evans gentoo.org> Tested-by: Brian Evans gentoo.org> Signed-off-by: Sergei Trofimovich gentoo.org> src/rc/rc-logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c index b4bd0eae..062ce3d9 100644 --- a/src/rc/rc-logger.c +++ b/src/rc/rc-logger.c @@ -261,12 +261,12 @@ rc_logger_open(const char *level) break; } } + fclose(log); } else { log_error = 1; eerror("Error: fopen(%s) failed: %s", TMPLOG, strerror(errno)); } - fclose(log); fclose(plog); } else { /*