HomeFreeBSD

bsdinstall: Handle errors from geom_gettree.

Description

bsdinstall: Handle errors from geom_gettree.

geom_gettree probably never fails, and if it does there isn't much of
a fallback other than aborting partitioning. However, a few places
were checking the return value and not doing anything with it
triggering a unused-but-set-variable warning. Checking the errors
resolves the warning.

While here, check for errors in other places that weren't checking for
them at all, remove a spurious double call (the second call overwrote
the mesh structure leaking all the pointers from the first), and close
a few resource leaks on error paths.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D40779

(cherry picked from commit 23099099196548550461ba427dcf09dcfb01878d)

Details

Provenance
jhbAuthored on Jun 28 2023, 6:11 PM
Reviewer
imp
Differential Revision
D40779: bsdinstall: Handle errors from geom_gettree.
Parents
rG3c9405052568: bsdinstall: Replace correct, but fragile, string builder with open_memstream.
Branches
Unknown
Tags
Unknown