Closing file unconditionally (#5886)

pull/5887/head
Bharath Gajjala 10 months ago committed by GitHub
parent c0aa1fbc7e
commit 6816909411
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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 {

Loading…
Cancel
Save