From 411d8d74391b8764b53d18f6bd78188cf651d5e5 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Tue, 26 Apr 2016 09:24:32 -0600 Subject: [PATCH] Fix leaky tcp connections in phpfpm plugin closes #1089 --- CHANGELOG.md | 1 + plugins/inputs/phpfpm/phpfpm.go | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2dded62e..320f11789 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ based on _prefix_ in addition to globs. This means that a filter like - [#1022](https://github.com/influxdata/telegraf/issues/1022): Dont error deb/rpm install on systemd errors. - [#1078](https://github.com/influxdata/telegraf/issues/1078): Use default AWS credential chain. - [#1070](https://github.com/influxdata/telegraf/issues/1070): SQL Server input. Fix datatype conversion. +- [#1089](https://github.com/influxdata/telegraf/issues/1089): Fix leaky TCP connections in phpfpm plugin. ## v0.12.1 [2016-04-14] diff --git a/plugins/inputs/phpfpm/phpfpm.go b/plugins/inputs/phpfpm/phpfpm.go index 169fe2194..3b23ef92c 100644 --- a/plugins/inputs/phpfpm/phpfpm.go +++ b/plugins/inputs/phpfpm/phpfpm.go @@ -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",