If vfs_buildopts() failed, vfs_freeopts() must not be called. Reported and tested by: pho
Details
Details
- Reviewers
jamie - Commits
- rG3f5f52216f7e: kern_jail_set(): do not double-free opts
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
While I prefer the version I mentioned in the inline notes (it's a little less branchy), I'm also fine with the patch as originally given.
| sys/kern/kern_jail.c | ||
|---|---|---|
| 1046 | This hold is the only reason that vfs_buildopts goes to done_free and doesn't just return outright... | |
| 1072 | ...so we could change the "goto done_free" above to "return (error)", and move "prison_hold(mypr)" here, just before the first of the remaining "goto done" lines... | |
| 2336–2337 | ...and then we wouldn't need to add this test. | |
Comment Actions
I did not wanted to restructure the main flow. If you consider it is worth to, please do as follow-up.