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 memory leak in util_spec_rb_get_kwargs #1134

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

peterzhu2118
Copy link
Member

The call to rb_get_kwargs could raise an exception, which would cause the ids and results to be leaked. This commit changes these two to be allocated on the stack using alloca instead of malloc so we don't need to free it.

The call to rb_get_kwargs could raise an exception, which would cause
the ids and results to be leaked. This commit changes these two to be
allocated on the stack using alloca instead of malloc so we don't need
to free it.
@peterzhu2118 peterzhu2118 force-pushed the rb-get-kwargs-mem-leak branch from 6fc4f9e to 20ed73a Compare February 5, 2024 20:09
Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

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

Thanks!

@eregon eregon merged commit 8261185 into ruby:master Feb 6, 2024
13 checks passed
@peterzhu2118 peterzhu2118 deleted the rb-get-kwargs-mem-leak branch February 6, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants