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: cgroup: Free memory_cgroup_file_path if open fails #317

Merged

Conversation

sheabot
Copy link
Contributor

@sheabot sheabot commented Jan 12, 2022

In src/cgroup.c, the variable memory_cgroup_file_path is allocated with g_build_filename(), but it is not free'd in the error path. In the happy path, it would be properly free'd in oom_cb_cgroup_v1().

Following that, in oom_cb_cgroup_v1() free this memory using g_free() instead of free(). Functionally, there is no difference, but semantically it's better.

@rhatdan
Copy link
Member

rhatdan commented Jan 13, 2022

LGTM

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM

@rhatdan rhatdan merged commit 283294c into containers:main Jan 13, 2022
@rhatdan
Copy link
Member

rhatdan commented Jan 13, 2022

Thanks @sheabot

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.

3 participants