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

[Bug]: IConsolePrint leaks string allocation in non-dedicated case #10010

Closed
JGRennison opened this issue Sep 9, 2022 · 0 comments
Closed

[Bug]: IConsolePrint leaks string allocation in non-dedicated case #10010

JGRennison opened this issue Sep 9, 2022 · 0 comments

Comments

@JGRennison
Copy link
Contributor

Version of OpenTTD

Sicne #9978 (e6aab70)

Expected result

No memory leaks

Actual result

IConsoleLine previously called free() on the allocated buffer passed to it in its constructor.

Now it makes a copy of a temporary std::string made from the string allocation. The string allocation is then leaked.

Steps to reproduce

See IConsolePrint.

A leak detector such as AddressSanitizer can be used.

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

No branches or pull requests

1 participant