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
This commit is contained in:
Oleksandr Tymoshenko 2019-01-18 00:26:25 +00:00
parent 236b57fe36
commit b63800ac8f

View File

@ -322,6 +322,8 @@ decompress(const char *in, const char *out, int bits)
if ((ofp = fopen(out, "w")) == NULL || if ((ofp = fopen(out, "w")) == NULL ||
(nr != 0 && fwrite(buf, 1, nr, ofp) != nr)) { (nr != 0 && fwrite(buf, 1, nr, ofp) != nr)) {
cwarn("%s", out); cwarn("%s", out);
if (ofp)
(void)fclose(ofp);
(void)fclose(ifp); (void)fclose(ifp);
return; return;
} }