From ee844a2b7561df2d9a076b93d1cb21e0ed0f75c8 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 12 Nov 2018 19:51:21 +0100 Subject: [PATCH] release buffer after use --- functions.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions.go b/functions.go index df2289aa6..5fb39dc29 100644 --- a/functions.go +++ b/functions.go @@ -22,6 +22,8 @@ func CreateObject(v *Instance, config interface{}) (interface{}, error) { // By default V2Ray only support config in protobuf format, i.e., configFormat = "protobuf". Caller need to load other packages to add JSON support. func StartInstance(configFormat string, configBytes []byte) (*Instance, error) { var mb buf.MultiBuffer + defer mb.Release() + common.Must2(mb.Write(configBytes)) config, err := LoadConfig(configFormat, "", &mb) if err != nil {