mirror of https://github.com/v2ray/v2ray-core
release buffer on error
parent
0b388280ce
commit
89fa9367ba
|
@ -256,6 +256,7 @@ func msgToBuffer(msg *dns.Msg) (*buf.Buffer, error) {
|
|||
writtenBuffer, err := msg.PackBuffer(b)
|
||||
return len(writtenBuffer), err
|
||||
}); err != nil {
|
||||
buffer.Release()
|
||||
return nil, err
|
||||
}
|
||||
return buffer, nil
|
||||
|
|
Loading…
Reference in New Issue