fix (leak): ressource leak on FTP

This commit is contained in:
Mickael Kerjean
2021-03-21 16:16:24 +11:00
parent 7f5a76849a
commit 32891e62bc

View File

@ -85,6 +85,7 @@ func (f Ftp) Init(params map[string]string, app *App) (IBackend, error) {
return backend, err
}
if _, err := client.ReadDir("/"); err != nil {
client.Close()
return backend, ErrAuthenticationFailed
}
backend = &Ftp{client}