summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pack.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pack.c b/src/pack.c
index 2ee0c60e4..16e82a92b 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -757,8 +757,11 @@ int git_packfile_unpack(
}
cleanup:
- if (error < 0)
+ if (error < 0) {
git__free(obj->data);
+ if (cached)
+ git_atomic_dec(&cached->refcount);
+ }
if (elem)
*obj_offset = curpos;