Bug 204952

Summary: usr/src/sbin/recoverdisk/recoverdisk.c:132: resource leak ?
Product: Base System Reporter: David Binderman <dcb314>
Component: miscAssignee: Andriy Voskoboinyk <avos>
Status: Closed FIXED    
Severity: Affects Some People CC: avos
Priority: --- Flags: avos: mfc-stable12+
avos: mfc-stable11+
avos: mfc-stable10+
Version: CURRENT   
Hardware: Any   
OS: Any   

Description David Binderman 2015-12-02 08:24:39 UTC
[usr/src/sbin/recoverdisk/recoverdisk.c:132]: (error) Resource leak: file

$ fgrep file usr/src/sbin/recoverdisk/recoverdisk.c | egrep "fopen|fclose"
		file = fopen(wworklist, "w");
		fclose(file);
	file = fopen(rworklist, "r");
$
Comment 1 commit-hook freebsd_committer 2019-02-07 14:41:04 UTC
A commit references this bug:

Author: avos
Date: Thu Feb  7 14:40:28 UTC 2019
New revision: 343871
URL: https://svnweb.freebsd.org/changeset/base/343871

Log:
  recoverdisk(1): fclose() file supplied via '-r readlist' parameter when
  it's no longer needed

  PR:		204952
  Reported by:	David Binderman <dcb314@hotmail.com>
  MFC after:	5 days

Changes:
  head/sbin/recoverdisk/recoverdisk.c
Comment 2 commit-hook freebsd_committer 2019-02-13 09:29:31 UTC
A commit references this bug:

Author: avos
Date: Wed Feb 13 09:28:49 UTC 2019
New revision: 344091
URL: https://svnweb.freebsd.org/changeset/base/344091

Log:
  MFC r343871:
  recoverdisk(1): fclose() file supplied via '-r readlist' parameter when
  it's no longer needed

  PR:		204952
  Reported by:	David Binderman <dcb314@hotmail.com>

Changes:
_U  stable/10/
  stable/10/sbin/recoverdisk/recoverdisk.c
_U  stable/11/
  stable/11/sbin/recoverdisk/recoverdisk.c
_U  stable/12/
  stable/12/sbin/recoverdisk/recoverdisk.c