diff options
author | Wim <wim@42.be> | 2018-02-07 00:04:02 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-02-07 00:04:02 +0100 |
commit | 3480c88e904c6234309ed20c88aff7d0a684e87f (patch) | |
tree | 2b71bdc2b713d9fea845974431fedde9274a0383 | |
parent | 432cd0f99df8fea2fa9c4c454b3492da6dcee578 (diff) | |
download | matterbridge-msglm-3480c88e904c6234309ed20c88aff7d0a684e87f.tar.gz matterbridge-msglm-3480c88e904c6234309ed20c88aff7d0a684e87f.tar.bz2 matterbridge-msglm-3480c88e904c6234309ed20c88aff7d0a684e87f.zip |
Do not close body on err. Closes #364
-rw-r--r-- | bridge/helper/helper.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bridge/helper/helper.go b/bridge/helper/helper.go index bfa9e64b..9522823b 100644 --- a/bridge/helper/helper.go +++ b/bridge/helper/helper.go @@ -20,9 +20,9 @@ func DownloadFile(url string) (*[]byte, error) { } resp, err := client.Do(req) if err != nil { - resp.Body.Close() return nil, err } + defer resp.Body.Close() io.Copy(&buf, resp.Body) data := buf.Bytes() resp.Body.Close() |