outbrain / orchestrator-agent

MySQL replication topology manager - agent (daemon)
Apache License 2.0
35 stars 53 forks source link

close http response body #2

Closed BrianIp closed 9 years ago

BrianIp commented 9 years ago

Fix tcp connection leak by closing Body from an http.Get. Potentially fixes https://github.com/outbrain/orchestrator/issues/37, if not, fixes another leak anyways.

shlomi-noach commented 9 years ago

Will merge; but need to check if response != nil before derering

BrianIp commented 9 years ago

Moved the defer response.Body.Close() to after checking err. According to golang specs, Get returns a non-nil response.Body if err is nil.