Co-authored-by: huanghuan.27@bytedance.com <huanghuan.27@bytedance.com>
This commit is contained in:
Huan Huang 2020-07-09 17:28:20 +08:00 committed by GitHub
parent 3468331506
commit e5db6ea8a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,6 +85,7 @@ func encode(txt *mdnsTxt) ([]string, error) {
w := zlib.NewWriter(&buf)
if _, err := w.Write(b); err != nil {
w.Close()
return nil, err
}
w.Close()
@ -119,6 +120,7 @@ func decode(record []string) (*mdnsTxt, error) {
br := bytes.NewReader(hr)
zr, err := zlib.NewReader(br)
defer zr.Close()
if err != nil {
return nil, err
}