HomeFreeBSD

config: push path() into moveifchanged()

Description

config: push path() into moveifchanged()

Every caller path()s its arguments anyways, just simplify these and push
path() into moveifchanged(). This fixes a number of memory leaks in the
process since path() allocates memory, which we will now free().

While we're here, make sure we close from_fd/to_fd appropriately.

CID: 1471040, 1471714, 1472045, 1006907, 1006908
Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D38641

Details

Provenance
kevansAuthored on Feb 16 2023, 8:36 PM
Reviewer
emaste
Differential Revision
D38641: config: push path() into moveifchanged()
Parents
rGf518229d5520: config: fix some common issues with path() usage
Branches
Unknown
Tags
Unknown