Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pack: dereference cached pack entry on error #4027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2016

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented Dec 12, 2016

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.

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.
@pks-t
Copy link
Member Author

pks-t commented Dec 12, 2016

Just noticed this possible memory leak/reference count error as I took a quick look at #4023. It might cause the issue in case where we fail to unpack packfiles over NFS, as we would have a mismatched reference count then, triggering the assert. But I think it is rather unlikely.

@carlosmn carlosmn merged commit 903955f into libgit2:master Dec 19, 2016
@pks-t pks-t deleted the pks/pack-deref-cache-on-error branch February 8, 2017 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants