]> git.proxmox.com Git - libgit2.git/commit - src/pack.c
pack: dereference cached pack entry on error
authorPatrick Steinhardt <ps@pks.im>
Mon, 12 Dec 2016 08:36:15 +0000 (09:36 +0100)
committerPatrick Steinhardt <ps@pks.im>
Mon, 12 Dec 2016 08:45:07 +0000 (09:45 +0100)
commitff5eea06a98182697f16d1335ee331cd8cd1b90c
tree7df75d7c133b45fa391948a2af38c89be37805b1
parent8339c66068c8e964f8bf1eca10745db730bf62fa
pack: dereference cached pack entry on error

When trying to uncompress deltas in a packfile's delta chain, we try to
add object bases to the packfile cache, subsequently decrementing its
reference count if it has been added successfully. This may lead to a
mismatched reference count in the case where we exit the loop early due
to an encountered error.

Fix the issue by decrementing the reference count in error cleanup.
src/pack.c