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)
Sat, Jan 4, 4:35 PM
Unknown Object (File)
Thu, Dec 26, 1:46 AM
Unknown Object (File)
Dec 3 2024, 1:17 AM
Unknown Object (File)
Dec 2 2024, 1:56 PM
Unknown Object (File)
Nov 23 2024, 10:01 AM
Unknown Object (File)
Nov 19 2024, 9:09 AM
Unknown Object (File)
Nov 19 2024, 6:41 AM
Unknown Object (File)
Nov 18 2024, 4:38 PM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 49857
Build 46748: arc lint + arc unit

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.