gzip: Use calloc in initcompress() and initdecompress()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Этот коммит содержится в:
родитель
f1608778be
Коммит
07986731c6
@ -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) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user