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

format leaks memory #1432

Open
iacore opened this issue Sep 19, 2022 · 1 comment
Open

format leaks memory #1432

iacore opened this issue Sep 19, 2022 · 1 comment
Assignees
Labels

Comments

@iacore
Copy link

iacore commented Sep 19, 2022

> (format "%d%d" 1)
1-1900850528
> (format "%d %d" 1)
1 279724704
@hellerve
Copy link
Member

Thanks for reporting!

For a safe multi-argument version, please use fmt. format is a thin wrapper around the C APIs for single arguments and doesn’t do any checking. fmt is vararg, and does compile-time checking to see that the number of formatting primitives and arguments checks out.

We could and should probably still add a (compile-time) check that ensures that there is only one formatting expression in the first argument to format.

@hellerve hellerve self-assigned this Sep 19, 2022
@hellerve hellerve added the bug label Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants