Fix leaky tcp connections in phpfpm plugin

closes #1089
This commit is contained in:
Cameron Sparr
2016-04-26 09:24:32 -06:00
parent 671b40df2a
commit 411d8d7439
2 changed files with 2 additions and 0 deletions

View File

@@ -184,6 +184,7 @@ func (g *phpfpm) gatherHttp(addr string, acc telegraf.Accumulator) error {
return fmt.Errorf("Unable to connect to phpfpm status page '%s': %v",
addr, err)
}
defer res.Body.Close()
if res.StatusCode != 200 {
return fmt.Errorf("Unable to get valid stat result from '%s': %v",