NetBSD Problem Report #50579
From www@NetBSD.org Tue Dec 22 19:04:04 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 11EC77A20F
for <gnats-bugs@gnats.NetBSD.org>; Tue, 22 Dec 2015 19:04:04 +0000 (UTC)
Message-Id: <20151222190403.28C647ACB0@mollari.NetBSD.org>
Date: Tue, 22 Dec 2015 19:04:03 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/usr.bin/error/filter.c:117: Resource leak
X-Send-Pr-Version: www-1.0
>Number: 50579
>Category: bin
>Synopsis: src/usr.bin/error/filter.c:117: Resource leak
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Dec 22 19:05:00 +0000 2015
>Closed-Date: Mon May 30 16:33:43 +0000 2016
>Last-Modified: Mon May 30 16:33:43 +0000 2016
>Originator: David Binderman
>Release: cvs dated 20151222
>Organization:
>Environment:
>Description:
[src/usr.bin/error/filter.c:117]: (error) Resource leak: fyle
if (freopen(filename, "r", fyle) == NULL) {
#ifdef FULLDEBUG
fprintf(stderr, "%s: Failure to open \"%s\" for second read.\n",
processname, filename);
#endif
nignored = 0;
return;
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/50579 CVS commit: src/usr.bin/error
Date: Mon, 30 May 2016 16:26:34 +0000
Module Name: src
Committed By: dholland
Date: Mon May 30 16:26:34 UTC 2016
Modified Files:
src/usr.bin/error: filter.c
Log Message:
Use rewind() instead of freopen()'ing the same file for no reason. Also,
close the file when done instead of dropping it on the floor. Obsoletes
PR 50579.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/error/filter.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 30 May 2016 16:33:43 +0000
State-Changed-Why:
fixed, thanks
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.