mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-12 03:00:26 +09:00
gzip: Move cleanup to separate function
to avoid exposing gzip function into wrapper.c
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 00fce9cb6c)
This commit is contained in:
14
src/gzip.c
14
src/gzip.c
@@ -260,3 +260,17 @@ decompress_buffer(ssh_session session, ssh_buffer buf, size_t maxlen)
|
||||
SSH_BUFFER_FREE(dest);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
compress_cleanup(struct ssh_crypto_struct *crypto)
|
||||
{
|
||||
if (crypto->compress_out_ctx) {
|
||||
deflateEnd(crypto->compress_out_ctx);
|
||||
}
|
||||
SAFE_FREE(crypto->compress_out_ctx);
|
||||
|
||||
if (crypto->compress_in_ctx) {
|
||||
inflateEnd(crypto->compress_in_ctx);
|
||||
}
|
||||
SAFE_FREE(crypto->compress_in_ctx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user