Possible memory leak when creating a region
Open
- Dominant language
- C
- Stars
- 25
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
I just noticed a possible memory leak:
https://github.com/awesomeWM/oocairo/blob/2aba6f923a04376397f85eda0e76e612c236860d/obj_region.c#L40-L50
The `calloc` result is leaked if an error happens (either via `luaL_error` or via `lua_next` doing a longjmp).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in obj_region.c at lines 40-50, where the region is created and the calloc result is handled. Trace the luaL_error and lua_next failure paths; done means those paths no longer leave the allocated region leaked, with the normal creation path still working.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, lua
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100