Bug 204952 - usr/src/sbin/recoverdisk/recoverdisk.c:132: resource leak ?
Summary: usr/src/sbin/recoverdisk/recoverdisk.c:132: resource leak ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Andriy Voskoboinyk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-02 08:24 UTC by David Binderman
Modified: 2019-02-13 09:30 UTC (History)
1 user (show)

See Also:
avos: mfc-stable10+
avos: mfc-stable11+
avos: mfc-stable12+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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