diff --git a/device_client.go b/device_client.go index 46c1f76..e54eb15 100644 --- a/device_client.go +++ b/device_client.go @@ -127,6 +127,7 @@ func (c *DeviceClient) Stat(path string) (*DirEntry, error) { if err != nil { return nil, wrapClientError(err, c, "Stat(%s)", path) } + defer conn.Close() entry, err := stat(conn, path) return entry, wrapClientError(err, c, "Stat(%s)", path)