Skip to content

Commit

Permalink
test/istream/TestGzipIstream: add missing inflateEnd() call
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jul 26, 2024
1 parent 4ab73fc commit fba48a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/istream/TestGzipIstream.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "istream/istream_string.hxx"
#include "istream/UnusedPtr.hxx"
#include "lib/zlib/Error.hxx"
#include "util/ScopeExit.hxx"

#include <zlib.h>

Expand All @@ -19,6 +20,8 @@ GunzipString(std::string_view src)
if (int result = inflateInit2(&z, 16 + MAX_WBITS); result != Z_OK)
throw MakeZlibError(result, "inflateInit2() failed");

AtScopeExit(&z) { inflateEnd(&z); };

std::array<char, 8192> dest_buffer;
z.next_in = const_cast<Bytef *>(reinterpret_cast<const Bytef *>(src.data()));
z.avail_in = src.size();
Expand Down

0 comments on commit fba48a3

Please sign in to comment.