Bug 192032 - [PATCH] savecore(8): Distinguish getbounds() errors; don't leak a FILE*
Summary: [PATCH] savecore(8): Distinguish getbounds() errors; don't leak a FILE*
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-22 12:48 UTC by Conrad Meyer
Modified: 2014-10-02 18:12 UTC (History)
1 user (show)

See Also:


Attachments
(apply with -p1 in src/) (808 bytes, patch)
2014-07-22 12:48 UTC, Conrad Meyer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Conrad Meyer 2014-07-22 12:48:08 UTC
Created attachment 144872 [details]
(apply with -p1 in src/)

Minor: when fgets(3) fails in getbounds(), check for EOF and if not EOF, print strerror(3).

Also, don't leak fp during non-error return (trivial since savecore(8) is not a long-running process anyway).

Sponsored by:	EMC / Isilon storage division
Comment 1 commit-hook freebsd_committer freebsd_triage 2014-09-17 19:10:47 UTC
A commit references this bug:

Author: bdrewery
Date: Wed Sep 17 19:09:58 UTC 2014
New revision: 271720
URL: http://svnweb.freebsd.org/changeset/base/271720

Log:
  If fgets(3) fails in getbounds(), show strerror(3) if not an EOF. Also fix
  a FILE* leak in getbounds().

  Submitted by:	Conrad Meyer <conrad.meyer@isilon.com>
  PR:		192032
  Sponsored by:	EMC / Isilon Storage Division
  MFC after:	1 week

Changes:
  head/sbin/savecore/savecore.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-10-02 18:11:23 UTC
A commit references this bug:

Author: bdrewery
Date: Thu Oct  2 18:11:14 UTC 2014
New revision: 272434
URL: https://svnweb.freebsd.org/changeset/base/272434

Log:
  MFC r271720:

    If fgets(3) fails in getbounds(), show strerror(3) if not an EOF. Also fix a
    FILE* leak in getbounds().

  PR:		192032
  Approved by:	re (gjb)

Changes:
_U  stable/10/
  stable/10/sbin/savecore/savecore.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-10-02 18:12:26 UTC
A commit references this bug:

Author: bdrewery
Date: Thu Oct  2 18:12:19 UTC 2014
New revision: 272435
URL: https://svnweb.freebsd.org/changeset/base/272435

Log:
  MFC r271720:

    If fgets(3) fails in getbounds(), show strerror(3) if not an EOF. Also fix a
    FILE* leak in getbounds().

  PR:		192032

Changes:
_U  stable/9/sbin/savecore/
  stable/9/sbin/savecore/savecore.c