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

Potential Memory Leak #426

Open
weiweiwei9811 opened this issue May 12, 2023 · 1 comment
Open

Potential Memory Leak #426

weiweiwei9811 opened this issue May 12, 2023 · 1 comment

Comments

@weiweiwei9811
Copy link

in war1tool.cpp:3669, the return of realpath() is not freed, this could cause memory leak.

base on the document, If resolved_path is specified as NULL, then realpath() uses malloc to allocate a buffer of up to PATH_MAX bytes to hold the resolved pathname, and returns a pointer to this buffer. The caller should deallocate this buffer using free.

in window platform, the realpath is defined as _fullpath, and from document,it is same as realpath in linux.

@timfel
Copy link
Member

timfel commented May 12, 2023

I am sure there are many memory leaks in war1tool :) It's a short running script, so I never really bothered to fix them (all platforms we support have OS-level reclaiming of virtual address space). PRs are welcome, but from my side I doubt it will get fixed

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