Skip to content

Conversation

@nobu
Copy link
Member

@nobu nobu commented Aug 31, 2021

Reverts #28, which skips the call to zstream_finalize which calls z->func->end.
This func points to deflate_funcs or inflate_funcs, and the end function is deflateEnd or inflateEnd.

The comments in zlib.h state that "all dynamically allocated data structures for this stream are freed" by these functions.

ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
     All dynamically allocated data structures for this stream are freed.
   This function discards any unprocessed input and does not flush any pending
   output.

     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
   prematurely (some input or output was discarded).  In the error case, msg
   may be set but then points to a static string (which must not be
   deallocated).
*/
ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
/*
     All dynamically allocated data structures for this stream are freed.
   This function discards any unprocessed input and does not flush any pending
   output.

     inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state
   was inconsistent.
*/

@nobu nobu merged commit 931aa7a into master Aug 31, 2021
@nobu nobu deleted the revert-28-free-less-warnings branch August 31, 2021 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants