Skip to content
Commit 29d355e7 authored by Wieland Hoffmann's avatar Wieland Hoffmann Committed by Zbigniew Jędrzejewski-Szmek
Browse files

fstab-generator: Prevent double free of reused FILE*

When the .automount unit file already existed for any reason in the
`normal-dir` passed to `systemd-fstab-generator`, but the normal .mount unit
file did not, `f` was closed (but _not_ set to NULL). The call to
`generator_open_unit_file(..., automount_name, &f)` then failed because the
.mount unit file already existed. Now `f` did not point to an open FILE and the
later cleanup from the `_cleanup_fclose_` attribute failed with a double free.
Reset `f` to NULL before reusing it.

(cherry picked from commit 8a7033ac)
parent f30f1adc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment