GOMC-WSU / GOMC

GOMC - GPU Optimized Monte Carlo is a parallel molecular simulation code designed for high-performance simulation of large systems
https://gomc-wsu.org
MIT License
74 stars 36 forks source link

Small Memory Leak with Get Current Directory #493

Closed LSchwiebert closed 1 year ago

LSchwiebert commented 1 year ago

Describe the bug

We print the current working directory. This introduces a small memory leak as the space allocated to store this path is not freed, but we don't use it after it is printed to the screen.

To Reproduce

This happens every time you run the code. You can see the memory leak using address sanitizer or valgrind.

Expected behavior

Should store the directory name in a temporary variable so that it can be freed after printing.

Screenshots

N/A

Input files

N/A

Please complete the following information:

Additional context

I will push a patch soon.