mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Fix large memleak in decompression when output does not go to stdout. Same sort of logic already exists in compression.
This commit is contained in:
parent
6e0016daf7
commit
1510f4a26a
8
lrzip.c
8
lrzip.c
|
|
@ -788,8 +788,9 @@ bool decompress_file(rzip_control *control)
|
|||
}
|
||||
}
|
||||
|
||||
if (unlikely(!open_tmpoutbuf(control)))
|
||||
return false;
|
||||
if ( STDOUT )
|
||||
if (unlikely(!open_tmpoutbuf(control)))
|
||||
return false;
|
||||
|
||||
if (!STDIN) {
|
||||
if (unlikely(!read_magic(control, fd_in, &expected_size)))
|
||||
|
|
@ -845,6 +846,9 @@ bool decompress_file(rzip_control *control)
|
|||
else
|
||||
print_progress("[OK] \n");
|
||||
|
||||
if (TMP_OUTBUF)
|
||||
close_tmpoutbuf(control);
|
||||
|
||||
if (fd_out > 0) {
|
||||
if (unlikely(close(fd_hist) || close(fd_out)))
|
||||
fatal_return(("Failed to close files\n"), false);
|
||||
|
|
|
|||
Loading…
Reference in a new issue