The memory assigned to the local variable 'copy' is mostly freed.
The case where is can not be freed is noted with a comment.
Details
Details
Run clang's static analyzer scan-build before to find the problem. Run scan-build after to show the problem is reduced to the use of 'copy' in the badmopt: location.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
usr.bin/tset/map.c | ||
---|---|---|
85 ↗ | (On Diff #25350) | I don't understand this change. What's the advantage of calling free() if you're already going to call errx()? |
usr.bin/tset/map.c | ||
---|---|---|
178 ↗ | (On Diff #25378) | Could you please move the call to free() closer to to the site where the variable is last used? Thanks! |
usr.bin/tset/map.c | ||
---|---|---|
161 ↗ | (On Diff #25422) | I think assignments like these are typically not done in our codebase, especially not for local variables. Statements like these tend to have no effect, as the compiler will optimize it out anyway. Apart from that, it looks good! |