mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-24 19:52:03 -08:00
Do not close body on err. Closes #364
This commit is contained in:
parent
432cd0f99d
commit
3480c88e90
@ -20,9 +20,9 @@ func DownloadFile(url string) (*[]byte, error) {
|
|||||||
}
|
}
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
resp.Body.Close()
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
io.Copy(&buf, resp.Body)
|
io.Copy(&buf, resp.Body)
|
||||||
data := buf.Bytes()
|
data := buf.Bytes()
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user