yandex: Fix socket leaks

This commit is contained in:
Nick Craig-Wood
2015-12-30 14:30:16 +00:00
parent 82b85431bd
commit 9ade179407
7 changed files with 14 additions and 13 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ func (c *Client) Download(remotePath string) (io.ReadCloser, error) { //io.Write
}
// DownloadRequest will make an download request and return a URL to download data to.
func (c *Client) DownloadRequest(remotePath string) (*DownloadResponse, error) {
func (c *Client) DownloadRequest(remotePath string) (ur *DownloadResponse, err error) {
values := url.Values{}
values.Add("path", remotePath)
@@ -41,7 +41,7 @@ func (c *Client) DownloadRequest(remotePath string) (*DownloadResponse, error) {
}
defer CheckClose(resp.Body, &err)
ur, err := ParseDownloadResponse(resp.Body)
ur, err = ParseDownloadResponse(resp.Body)
if err != nil {
return nil, err
}