pack-objects: remove redundant and wrong call to deflateEnd()
authorJunio C Hamano <gitster@pobox.com>
Fri, 11 Jan 2008 07:26:09 +0000 (23:26 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 11 Jan 2008 07:27:39 +0000 (23:27 -0800)
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 <gitster@pobox.com>
builtin-pack-objects.c
index a39cb82c9beb5c44f59c459bfc6ac384b42b6b3c..ec10238e4a0d81773820d255ed0861dd66e0c3d6 100644 (file)
@@ -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.