summaryrefslogtreecommitdiffstats
path: root/bridge/helper
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-02-07 00:04:02 +0100
committerWim <wim@42.be>2018-02-07 00:04:02 +0100
commit3480c88e904c6234309ed20c88aff7d0a684e87f (patch)
tree2b71bdc2b713d9fea845974431fedde9274a0383 /bridge/helper
parent432cd0f99df8fea2fa9c4c454b3492da6dcee578 (diff)
downloadmatterbridge-msglm-3480c88e904c6234309ed20c88aff7d0a684e87f.tar.gz
matterbridge-msglm-3480c88e904c6234309ed20c88aff7d0a684e87f.tar.bz2
matterbridge-msglm-3480c88e904c6234309ed20c88aff7d0a684e87f.zip
Do not close body on err. Closes #364
Diffstat (limited to 'bridge/helper')
-rw-r--r--bridge/helper/helper.go2
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()