manifest: use Sync instead of Close

This commit is contained in:
Lukas Zapletal 2025-04-23 10:04:05 +02:00 committed by Michael Vogt
parent c829e60649
commit 4c9f2b4ba4

View file

@ -41,13 +41,13 @@ func sbomWriter(outputDir, filename string, content io.Reader) error {
if err != nil {
return err
}
// ensure we do not leak FDs if the function returns prematurely
defer f.Close()
if _, err := io.Copy(f, content); err != nil {
return err
}
return f.Close()
return f.Sync()
}
// used in tests