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

bugfix: fix possible memory leak in fs_home.c #6598

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

peter15914
Copy link
Contributor

@peter15914 peter15914 commented Jan 3, 2025

The pointer returned by asprintf() should be passed to free() to release the allocated storage when it is no longer needed.
There was one exit point without previous freeing src.

Relates to:

@peter15914 peter15914 marked this pull request as ready for review January 3, 2025 15:02
@kmk3 kmk3 added the bugfix This fixes a bug label Jan 4, 2025
@kmk3 kmk3 force-pushed the fix_memory_leak branch from 663c9b5 to b88bc52 Compare January 4, 2025 01:29
@kmk3 kmk3 changed the title Fix possible memory leak bugfix: fix possible memory leak in fs_home.c Jan 4, 2025
@kmk3 kmk3 merged commit edfa7f1 into netblue30:master Jan 4, 2025
13 checks passed
@kmk3
Copy link
Collaborator

kmk3 commented Jan 4, 2025

@peter15914

By the way, I see that you fixed similar issues on multiple other projects.

Are you using any specific tool to check for this?

kmk3 added a commit that referenced this pull request Jan 4, 2025
@peter15914
Copy link
Contributor Author

@peter15914

By the way, I see that you fixed similar issues on multiple other projects.

Are you using any specific tool to check for this?

Yes, I use a specific tool, a kind of static code analyzer, but this tool is not public.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This fixes a bug
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

2 participants