From df4c24a01e91673b95f642ef0e42bcef7c41f12e 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) } } }