From 7367e699d3c4c9a3c728c95e42b8ffcb7163f1ec Mon Sep 17 00:00:00 2001 From: Collin Guarino Date: Sun, 28 Feb 2016 11:54:54 -0500 Subject: Added defer on response body to close after HandleResponse finishes. --- bridge.go | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3