HomeFreeBSD

Close the input FILE * in read_file() and the output FILE * in write_file()

Description

Close the input FILE * in read_file() and the output FILE * in write_file()
if read_stream() or write_stream() fails to avoid leaking the FILE.

Reported by: Coverity
CID: 977702
Reviewed by: pfg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6554

Details

Provenance
truckmanAuthored on
Reviewer
pfg
Differential Revision
D6554: Fix CID 977702 (Resource leak) in ed io.c
Parents
rS300691: Fix issues found by Coverity in the rtld-elf.c:gethints().
Branches
Unknown
Tags
Unknown