mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-08 03:42:12 +03:00
gzip: Avoid potential memory leak
Thanks coverity CID 1589436 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -50,6 +50,7 @@ initcompress(ssh_session session, int level)
|
||||
|
||||
status = deflateInit(stream, level);
|
||||
if (status != Z_OK) {
|
||||
deflateEnd(stream);
|
||||
SAFE_FREE(stream);
|
||||
ssh_set_error(session,
|
||||
SSH_FATAL,
|
||||
@@ -158,6 +159,7 @@ initdecompress(ssh_session session)
|
||||
|
||||
status = inflateInit(stream);
|
||||
if (status != Z_OK) {
|
||||
inflateEnd(stream);
|
||||
SAFE_FREE(stream);
|
||||
ssh_set_error(session,
|
||||
SSH_FATAL,
|
||||
|
||||
Reference in New Issue
Block a user