Use bufferpool in Rst handler

This commit is contained in:
Bjørn Erik Pedersen 2016-07-10 12:54:15 +02:00
parent 00d70e5569
commit d9bc233f1f

View file

@ -517,8 +517,9 @@ func getRstContent(content []byte) []byte {
cmd := exec.Command(path, "--leave-comments")
cmd.Stdin = bytes.NewReader(cleanContent)
var out bytes.Buffer
cmd.Stdout = &out
out := bufferpool.GetBuffer()
defer bufferpool.PutBuffer(out)
cmd.Stdout = out
if err := cmd.Run(); err != nil {
jww.ERROR.Println(err)
}