Skip to content

Commit 73aea97

Browse files
fix: close file handle on GetEncoding error in outCommand
1 parent 4373e17 commit 73aea97

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

pkg/sqlcmd/commands.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ func outCommand(s *Sqlcmd, args []string, line uint) error {
330330
// Use specified output codepage
331331
enc, err := GetEncoding(s.CodePage.OutputCodePage)
332332
if err != nil {
333+
_ = o.Close()
333334
return err
334335
}
335336
if enc != nil {

0 commit comments

Comments
 (0)