Page MenuHomeFreeBSD

config: address a number of Coverity issues
ClosedPublic

Authored by kevans on Feb 16 2023, 5:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 12, 6:47 AM
Unknown Object (File)
Mar 12 2024, 1:43 PM
Unknown Object (File)
Mar 12 2024, 1:43 PM
Unknown Object (File)
Mar 12 2024, 1:39 PM
Unknown Object (File)
Mar 8 2024, 6:07 AM
Unknown Object (File)
Dec 22 2023, 11:53 PM
Unknown Object (File)
Dec 12 2023, 10:21 AM
Unknown Object (File)
Jul 1 2023, 9:42 AM
Subscribers
None

Details

Summary

Highlights:

  • Various memory leaks
  • FILE* leaks
  • tsize in moveifchanged() is only needed if !changed, and from_sb is only valid if !changed.
  • Simplify trivially true expression
  • Sanity check elfdump size output (+ fix variable sizes) (des@)

CID: 1471167, 1006391, 1505279, 1505333, 1505271, 1505275, 1505349
CID: 1505306, 1505232

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans created this revision.

These changes look good, same comments about chunking, and I don't understand the path() changes... they seem to be spread over all these comits and I'm missing the connections to the other things... they might be better as a separate commit combining them all since that seems to be self contained... Or there needs to be a callout more explicitly in the commit message providing the context I'm clearly missing.

usr.sbin/config/main.cc
694

These changes aren't in the commit log, and look to be independent of all the others

usr.sbin/config/mkoptions.cc
311

another of this pattern... Unsure how it relates to the commit message.

This revision is now accepted and ready to land.Feb 16 2023, 5:39 PM

Agree with @imp these are all pretty straightforward changes but I would split them out

usr.sbin/config/main.cc
694

Glossed over as "various memory leaks" because path() allocates memory that we drop on the floor, but I can separate these out into a separate commit since it's a common issue with handling its return value.

This revision was automatically updated to reflect the committed changes.