Skip to content
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

Fix race in git_packfile_unpack. #2907

Merged
merged 1 commit into from Feb 20, 2015
Merged

Fix race in git_packfile_unpack. #2907

merged 1 commit into from Feb 20, 2015

Conversation

jasonhaslam
Copy link

Increment refcount of newly added cache entries just like existing
entries looked up from the cache. Otherwise the new entry can be
evicted from the cache and destroyed while it's still in use.

This is a possible fix for issue #2906.

@carlosmn
Copy link
Member

It is unecessary to hold the lock in order to increase the refcount. new_cache_object() should instead return an object which already has a refcount of 1.

Increment refcount of newly added cache entries just like existing
entries looked up from the cache. Otherwise the new entry can be
evicted from the cache and destroyed while it's still in use.
@jasonhaslam
Copy link
Author

Okay, updated.

@carlosmn
Copy link
Member

👍

carlosmn added a commit that referenced this pull request Feb 20, 2015
@carlosmn carlosmn merged commit 5091aff into libgit2:master Feb 20, 2015
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.

None yet

3 participants