From 8c3c7b2adbac9d4fce1fcec0ca03cfb6535d5af3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 10 Jan 2008 23:26:09 -0800 Subject: [PATCH] pack-objects: remove redundant and wrong call to deflateEnd() We somehow called deflateEnd() on a stream that we have called deflateEnd() on already. In fact, the second deflateEnd() has always been returning Z_STREAM_ERROR. We just never checked the error return from that particular deflateEnd(). The first one returns 0 for success. We might want to tighten the check even more to check that. Noticed by Marco. Signed-off-by: Junio C Hamano --- builtin-pack-objects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index a39cb82c9..ec10238e4 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -445,7 +445,7 @@ static unsigned long write_object(struct sha1file *f, /* nothing */; deflateEnd(&stream); datalen = stream.total_out; - deflateEnd(&stream); + /* * The object header is a byte of 'type' followed by zero or * more bytes of length. -- 2.26.2