Skip to content

Commit

Permalink
pack-objects: remove redundant and wrong call to deflateEnd()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jan 11, 2008
1 parent 95693d4 commit 8c3c7b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8c3c7b2

Please sign in to comment.