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

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 LordAro added backport requested This PR should be backport to current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Feb 9, 2020
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 as completed in e340934 Feb 9, 2020
douiwby pushed 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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants