aboutsummaryrefslogtreecommitdiffstats
path: root/object-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'object-file.c')
-rw-r--r--object-file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/object-file.c b/object-file.c
index f9713e4e8b..9f6e8504fb 100644
--- a/object-file.c
+++ b/object-file.c
@@ -1347,15 +1347,15 @@ static void *unpack_loose_rest(git_zstream *stream,
obj_read_lock();
}
}
- if (status == Z_STREAM_END && !stream->avail_in) {
- return buf;
- }
if (status != Z_STREAM_END)
error(_("corrupt loose object '%s'"), oid_to_hex(oid));
else if (stream->avail_in)
error(_("garbage at end of loose object '%s'"),
oid_to_hex(oid));
+ else
+ return buf;
+
free(buf);
return NULL;
}