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(pkg/rootless): fix get_cmd_line_args memleak in rootless_linux. #25040

Closed
wants to merge 1 commit into from

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Jan 17, 2025

The assignment to NULL was preventing gcc cleanup attribute to auto-free the pointer for us, since it received a pointer to a NULL pointer.

Spotted using -fsanitize=address:

==1050100==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x70591a2fd9c7 in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x705915490406 in get_cmd_line_args /home/federico/go/pkg/mod/github.com/containers/podman/[email protected]/pkg/rootless/rootless_linux.c:313

Does this PR introduce a user-facing change?

None

The assignment to NULL was preventing gcc `cleanup` attribute to auto-free
the pointer for us, since it received a pointer to a NULL pointer.

Signed-off-by: Federico Di Pierro <[email protected]>
Copy link
Contributor

openshift-ci bot commented Jan 17, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: FedeDP
Once this PR has been reviewed and has the lgtm label, please assign mheon for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@FedeDP
Copy link
Contributor Author

FedeDP commented Jan 17, 2025

Uh wrong analysis; will double check to understand where does the leak come from.
Sorry for the noise :/

@FedeDP FedeDP closed this Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant