Skip to content

Commit 431f4e0

Browse files
authored
Ensure response body is always closed in CloudControllerConnection (#2423)
1 parent 0e82c66 commit 431f4e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/cloudcontroller/cloud_controller_connection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func (connection *CloudControllerConnection) Make(request *Request, passedRespon
5555
if err != nil {
5656
return connection.processRequestErrors(request.Request, err)
5757
}
58+
defer response.Body.Close()
5859

5960
return connection.populateResponse(response, passedResponse)
6061
}
@@ -64,7 +65,6 @@ func (*CloudControllerConnection) handleStatusCodes(response *http.Response, pas
6465
passedResponse.RawResponse = []byte("{}")
6566
} else {
6667
rawBytes, err := ioutil.ReadAll(response.Body)
67-
defer response.Body.Close()
6868
if err != nil {
6969
return err
7070
}

0 commit comments

Comments
 (0)