From 4fab572b6bec4326d03d13c38095f89a44c02b53 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 5 Oct 2017 12:12:14 -0700 Subject: [PATCH] Release buffer back to pool earlier --- plugins/inputs/statsd/statsd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/statsd/statsd.go b/plugins/inputs/statsd/statsd.go index 67ce29cd8..db412b549 100644 --- a/plugins/inputs/statsd/statsd.go +++ b/plugins/inputs/statsd/statsd.go @@ -427,13 +427,13 @@ func (s *Statsd) parser() error { return nil case buf := <-s.in: lines := strings.Split(buf.String(), "\n") + s.bufPool.Put(buf) for _, line := range lines { line = strings.TrimSpace(line) if line != "" { s.parseStatsdLine(line) } } - s.bufPool.Put(buf) } } }