release buffer on error

pull/1269/head
Darien Raymond 6 years ago
parent 0b388280ce
commit 89fa9367ba
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -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…
Cancel
Save