Fix assignment to deallocated buffer in failed decompression.

This commit is contained in:
Con Kolivas 2018-05-16 14:16:49 +10:00
parent d212cc1115
commit 1971c00950

View file

@ -456,8 +456,7 @@ static int zpaq_decompress_buf(rzip_control *control __UNUSED__, struct uncomp_t
if (unlikely(dlen != ucthread->u_len)) {
print_err("Inconsistent length after decompression. Got %ld bytes, expected %lld\n", dlen, ucthread->u_len);
ret = -1;
}
} else
dealloc(c_buf);
out:
if (ret == -1)
@ -491,8 +490,7 @@ static int bzip2_decompress_buf(rzip_control *control __UNUSED__, struct uncomp_
if (unlikely(dlen != ucthread->u_len)) {
print_err("Inconsistent length after decompression. Got %d bytes, expected %lld\n", dlen, ucthread->u_len);
ret = -1;
}
} else
dealloc(c_buf);
out:
if (ret == -1)
@ -526,8 +524,7 @@ static int gzip_decompress_buf(rzip_control *control __UNUSED__, struct uncomp_t
if (unlikely((i64)dlen != ucthread->u_len)) {
print_err("Inconsistent length after decompression. Got %ld bytes, expected %lld\n", dlen, ucthread->u_len);
ret = -1;
}
} else
dealloc(c_buf);
out:
if (ret == -1)
@ -564,8 +561,7 @@ static int lzma_decompress_buf(rzip_control *control, struct uncomp_thread *ucth
if (unlikely((i64)dlen != ucthread->u_len)) {
print_err("Inconsistent length after decompression. Got %lld bytes, expected %lld\n", (i64)dlen, ucthread->u_len);
ret = -1;
}
} else
dealloc(c_buf);
out:
if (ret == -1)
@ -599,8 +595,7 @@ static int lzo_decompress_buf(rzip_control *control __UNUSED__, struct uncomp_th
if (unlikely((i64)dlen != ucthread->u_len)) {
print_err("Inconsistent length after decompression. Got %lu bytes, expected %lld\n", (unsigned long)dlen, ucthread->u_len);
ret = -1;
}
} else
dealloc(c_buf);
out:
if (ret == -1)