Memory leaks in mcap_lib.c
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.2k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
The following memory leaks exist in mcap_lib.c. The line numbers are based on the following version of mcap_lib.c: "8826f30 on Nov 23, 2015"
- Line 81 in MCapProcessRBT calls getline with raw = NULL. According to the getline man page "If lineptr is NULL, then getline() will allocate a buffer for storing the line, which should be freed by the user program.". raw is never freed.
- Line 617 in MCapConfigureFPGA does not close fptr before returning
- Line 649 in MCapConfigureFPGA does not free data or close fptr before returning
- Line 654 in MCapConfigureFPGA does not free data or close fptr before returning
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read mcap_lib.c at the reported lines, starting with MCapProcessRBT and MCapConfigureFPGA. Trace the getline allocation and the listed return paths, then verify that raw, data, and fptr are cleaned up in each case; done means the reported leaks and unclosed file paths are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100