mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
wrapper: fix z_stream leak
Ensure to free the z_stream structures as allocated from the gzip.c initcompress, initdecompress functions. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
1ddb99c46f
commit
092fe0b727
@@ -170,10 +170,13 @@ void crypto_free(struct ssh_crypto_struct *crypto){
|
|||||||
(deflateEnd(crypto->compress_out_ctx) != 0)) {
|
(deflateEnd(crypto->compress_out_ctx) != 0)) {
|
||||||
inflateEnd(crypto->compress_out_ctx);
|
inflateEnd(crypto->compress_out_ctx);
|
||||||
}
|
}
|
||||||
|
SAFE_FREE(crypto->compress_out_ctx);
|
||||||
|
|
||||||
if (crypto->compress_in_ctx &&
|
if (crypto->compress_in_ctx &&
|
||||||
(deflateEnd(crypto->compress_in_ctx) != 0)) {
|
(deflateEnd(crypto->compress_in_ctx) != 0)) {
|
||||||
inflateEnd(crypto->compress_in_ctx);
|
inflateEnd(crypto->compress_in_ctx);
|
||||||
}
|
}
|
||||||
|
SAFE_FREE(crypto->compress_in_ctx);
|
||||||
#endif /* WITH_ZLIB */
|
#endif /* WITH_ZLIB */
|
||||||
if(crypto->encryptIV)
|
if(crypto->encryptIV)
|
||||||
SAFE_FREE(crypto->encryptIV);
|
SAFE_FREE(crypto->encryptIV);
|
||||||
|
|||||||
Reference in New Issue
Block a user