The memory assigned to the local variable 'ptr' is freed
Details
Details
- Reviewers
ken trix_juniper.net
Run clang's static analyzer scan-build before to find the problem. Run scan-build after to verify the problem is fixed.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Just take out the if statement and it's fine.
sbin/camcontrol/fwdownload.c | ||
---|---|---|
760 | Good catch. Since ptr is always either NULL or malloced memory, you can just pass it in to free(3) without the if statement. (free(3) will do nothing if the pointer is NULL.) |