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

composefs: Avoid double unref #2890

Merged
merged 1 commit into from
Jun 17, 2023

Conversation

cgwalters
Copy link
Member

The interaction of iter_loop and autofree is way too subtle; I happened to be reading this code and noticed we did the NULL reset in one path but not another.

The real fix is Rust...

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.

linter complaining



[2023-06-16T18:54:35.455Z] src/libostree/ostree-repo-composefs.c:464:31: error: code should be clang-formatted [-Wclang-format-violations]

[2023-06-16T18:54:35.455Z]       /* Freed by iter-loop */

[2023-06-16T18:54:35.455Z]                               ^

[2023-06-16T18:54:35.455Z] src/libostree/ostree-repo-composefs.c:465:32: error: code should be clang-formatted [-Wclang-format-violations]

[2023-06-16T18:54:35.455Z]       subdirtree_csum_v = NULL;

[2023-06-16T18:54:35.455Z]                                ^

otherwise lgtm

The interaction of `iter_loop` and autofree is way too subtle;
I happened to be reading this code and noticed we did the NULL
reset in one path but not another.

The real fix is Rust...
@cgwalters cgwalters changed the title composefs: Avoid double free in error path composefs: Avoid double unref Jun 17, 2023
@cgwalters cgwalters merged commit dd47090 into ostreedev:main Jun 17, 2023
19 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