aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-28 11:54:54 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-28 11:54:54 -0500
commit7367e699d3c4c9a3c728c95e42b8ffcb7163f1ec (patch)
treea4939a6f4919c39081444a994ee86d69f5bcbd26
parent03d273f61debf6fe68b8ddd461b5b96e1c32c764 (diff)
Added defer on response body to close after HandleResponse finishes.
-rw-r--r--bridge.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/bridge.go b/bridge.go
index c5cad71..1d541da 100644
--- a/bridge.go
+++ b/bridge.go
@@ -134,6 +134,7 @@ func (bridge *Bridge) Delete(path string) error {
// and invalid return types.
func HandleResponse(resp *http.Response) ([]byte, io.Reader, error) {
body, err := ioutil.ReadAll(resp.Body)
+ defer resp.Body.Close()
if err != nil {
trace("Error parsing bridge description xml.", nil)
return []byte{}, nil, err