From 9a6f1287fb69c46c7895f987ffea558b13ae79d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Thu, 5 Mar 2015 23:49:46 +0100 Subject: zlib: initialize git_zstream in git_deflate_init{,_gzip,_raw} Clear the git_zstream variable at the start of git_deflate_init() etc. so that callers don't have to do that. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- fast-import.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'fast-import.c') diff --git a/fast-import.c b/fast-import.c index fb4738d373..f757ef6b90 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1053,7 +1053,6 @@ static int store_object( } else delta = NULL; - memset(&s, 0, sizeof(s)); git_deflate_init(&s, pack_compression_level); if (delta) { s.next_in = delta; @@ -1081,7 +1080,6 @@ static int store_object( free(delta); delta = NULL; - memset(&s, 0, sizeof(s)); git_deflate_init(&s, pack_compression_level); s.next_in = (void *)dat->buf; s.avail_in = dat->len; @@ -1181,7 +1179,6 @@ static void stream_blob(uintmax_t len, unsigned char *sha1out, uintmax_t mark) crc32_begin(pack_file); - memset(&s, 0, sizeof(s)); git_deflate_init(&s, pack_compression_level); hdrlen = encode_in_pack_object_header(OBJ_BLOB, len, out_buf); -- cgit v1.2.1