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

ftpd.c frees static memory #3

Open
Nick507 opened this issue Mar 19, 2024 · 1 comment
Open

ftpd.c frees static memory #3

Nick507 opened this issue Mar 19, 2024 · 1 comment

Comments

@Nick507
Copy link

Nick507 commented Mar 19, 2024

For example, in cmd_list_common function:
free(cwd);
whereas cwd is result from vfs_getcwd, which returns cwd, which is static char cwd[100] = "/";

@terjeio
Copy link
Contributor

terjeio commented Mar 25, 2024

Normally the result is malloc'ed so the free is appropriate in most circumstances. I will take a look at this again as vfs_getcwd() is not supported across all filing systems.

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