diff --git a/src/gzip.c b/src/gzip.c index 349d53fb..23c9d0de 100644 --- a/src/gzip.c +++ b/src/gzip.c @@ -39,11 +39,10 @@ static z_stream *initcompress(ssh_session session, int level) { z_stream *stream = NULL; int status; - stream = malloc(sizeof(z_stream)); + stream = calloc(1, sizeof(z_stream)); if (stream == NULL) { return NULL; } - memset(stream, 0, sizeof(z_stream)); status = deflateInit(stream, level); if (status != Z_OK) { @@ -128,11 +127,10 @@ static z_stream *initdecompress(ssh_session session) { z_stream *stream = NULL; int status; - stream = malloc(sizeof(z_stream)); + stream = calloc(1, sizeof(z_stream)); if (stream == NULL) { return NULL; } - memset(stream,0,sizeof(z_stream)); status = inflateInit(stream); if (status != Z_OK) {