Author: gonzo Date: Sun Feb 3 21:18:46 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 <dcb...@hotmail.com> Modified: stable/12/usr.bin/compress/compress.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/compress/compress.c ============================================================================== --- stable/12/usr.bin/compress/compress.c Sun Feb 3 21:17:26 2019 (r343721) +++ stable/12/usr.bin/compress/compress.c Sun Feb 3 21:18:46 2019 (r343722) @@ -322,6 +322,8 @@ decompress(const char *in, const char *out, int bits) if ((ofp = fopen(out, "w")) == NULL || (nr != 0 && fwrite(buf, 1, nr, ofp) != nr)) { cwarn("%s", out); + if (ofp) + (void)fclose(ofp); (void)fclose(ifp); return; } _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"