Bug 204953 - usr/src/usr.bin/compress/compress.c:324: resource leak ?
Summary: usr/src/usr.bin/compress/compress.c:324: 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: Oleksandr Tymoshenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-02 08:31 UTC by David Binderman
Modified: 2019-02-03 21:19 UTC (History)
1 user (show)

See Also:


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:31:48 UTC
[usr/src/usr.bin/compress/compress.c:324]: (error) Resource leak: ofp

Source code is

    if ((ofp = fopen(out, "w")) == NULL ||
        (nr != 0 && fwrite(buf, 1, nr, ofp) != nr)) {
        cwarn("%s", out);
        (void)fclose(ifp);
        return;
    }
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-01-18 00:26:30 UTC
A commit references this bug:

Author: gonzo
Date: Fri Jan 18 00:26:25 UTC 2019
New revision: 343127
URL: https://svnweb.freebsd.org/changeset/base/343127

Log:
  Fix descriptor/memory leak in compress(1) code

  This is mostly a style fix since the code in question is not called multiple
  times and doesn't have cummulative effect.

  PR:		204953
  Submitted by:	David Binderman <dcb314@hotmail.com>
  MFC after:	1 week

Changes:
  head/usr.bin/compress/compress.c
Comment 2 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-18 00:35:35 UTC
Fix committed. Thanks for submitting.
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-02-03 21:19:36 UTC
A commit references this bug:

Author: gonzo
Date: Sun Feb  3 21:18:46 UTC 2019
New revision: 343722
URL: https://svnweb.freebsd.org/changeset/base/343722

Log:
  MFC r343127:

  Fix descriptor/memory leak in compress(1) code

  This is mostly a style fix since the code in question is not called multiple
  times and doesn't have cummulative effect.

  PR:		204953
  Submitted by:	David Binderman <dcb314@hotmail.com>

Changes:
_U  stable/12/
  stable/12/usr.bin/compress/compress.c