Repository navigation
Commit 89c5e97
Make the heap-owning SZ_compress overload exception-safe (ClickHouse)
The overload SZ_compress(const Config &, const T *, size_t &) allocated its
output buffer with a bare new char[] and returned it raw; if the inner
compression (e.g. Lossless_zstd::compress on poorly-compressible data) threw,
the buffer leaked. Hold it in std::unique_ptr and release only on success.
Co-Authored-By: Claude Fable 5 <[email protected]>1 parent 8e4db86 commit 89c5e97
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
98 | | - | |
99 | | - | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | | - | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
0 commit comments