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

Memory leak: Depot::name is not freed in destructor #7988

Closed
JGRennison opened this issue Feb 9, 2020 · 0 comments
Closed

Memory leak: Depot::name is not freed in destructor #7988

JGRennison opened this issue Feb 9, 2020 · 0 comments

Comments

@JGRennison
Copy link
Contributor

@JGRennison JGRennison commented Feb 9, 2020

Version of OpenTTD

Since 1a5d7b3

Expected result

The buffer pointed to by Depot::name is not leaked

Actual result

The buffer pointed to by Depot::name is leaked when:

  • A custom depot name is set (either from a loaded savegame, or set in the current game instance)
  • The struct Depot is destructed, either by demolishing the depot, or abandoning/quitting the game.

The leak does not occur if the default/reset name command is used.

Steps to reproduce

  • Give a depot custom name.
  • Demolish it or exit the game.
  • Check for leaks, e.g. using AddressSanitizer.
LordAro added a commit to LordAro/OpenTTD that referenced this issue Feb 9, 2020
LordAro added a commit to LordAro/OpenTTD that referenced this issue Feb 9, 2020
@LordAro LordAro closed this in e340934 Feb 9, 2020
LordAro added a commit that referenced this issue Feb 9, 2020
douiwby added a commit to douiwby/OpenTTD that referenced this issue Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.