Closing file unconditionally (#5886)

This commit is contained in:
Bharath Gajjala authored and GitHub committed 2025-06-27 23:31:37 -05:00
1 parent c0aa1fbc7e
commit 6816909411
1 file changed
+1
@@ -98,6 +98,7 @@ func (p *postgresFlags) buildArgs(c *Command, port, ip, _ string, creds proxy.Cr
})
_, err = passfile.WriteString(fmt.Sprintf("*:*:*:*:%s", password))
if err != nil {
_ = passfile.Close()
return nil, nil, proxy.Credentials{}, fmt.Errorf("Error writing password file to %s: %w", passfile.Name(), err)
}
if err := passfile.Close(); err != nil {