diff options
author | Alex Deymo <deymo@google.com> | 2018-03-12 19:23:35 +0100 |
---|---|---|
committer | Alex Deymo <deymo@google.com> | 2018-03-12 19:28:47 +0100 |
commit | c2ae7a5540ad4e69807777a9e5e521703aa8771d (patch) | |
tree | 297cc3ced782946df8643ac7f089776ed31dacf8 /brotli_decompressor.h | |
parent | 942194f5ec084aabf2f44fb857255adef4e89884 (diff) | |
download | bsdiff-c2ae7a5540ad4e69807777a9e5e521703aa8771d.tar.gz |
Destroy the brotli decompressor on destruction.
When the patching fails, we never close the decompressor which leaks
the internal decompressor structure. This patch keeps track of that and
releases it when needed.
Bug: chromium:819956
Test: Ran it through ASAN with the example provided in the bug before and after this patch.
Change-Id: Ia2664bba6898c7d10c441efd6269dd6d029787b8
Diffstat (limited to 'brotli_decompressor.h')
-rw-r--r-- | brotli_decompressor.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/brotli_decompressor.h b/brotli_decompressor.h index 0c63d8f..3c837c6 100644 --- a/brotli_decompressor.h +++ b/brotli_decompressor.h @@ -15,6 +15,7 @@ class BrotliDecompressor : public DecompressorInterface { public: BrotliDecompressor() : brotli_decoder_state_(nullptr), next_in_(nullptr), available_in_(0) {} + ~BrotliDecompressor(); // DecompressorInterface overrides. bool SetInputData(const uint8_t* input_data, size_t size) override; |