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

mutable-tree: Quiet clang-analyzer warning #3019

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

cgwalters
Copy link
Member

The warning here was about a use-after-free which is serious, but I don't think it was reachable in practice, because we'd only enter the second conditional if contents_checksum != self->contents_checksum, yet we made them the same thing here.

Nevertheless, refactor the code to do a direct return in this case because that's basically what happened before, and doing so is a lot clearer.

The warning here was about a use-after-free which is serious, but
I don't think it was reachable in practice, because we'd only
enter the second conditional if `contents_checksum != self->contents_checksum`,
yet we made them the same thing here.

Nevertheless, refactor the code to do a direct return in this
case because that's basically what happened before, and doing
so is a lot clearer.
Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cgwalters cgwalters merged commit 5837f27 into ostreedev:main Aug 29, 2023
24 checks passed
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

2 participants