diff --git a/src/net/dnsclient_unix.go b/src/net/dnsclient_unix.go index 21aa91f665a..7df536b01ff 100644 --- a/src/net/dnsclient_unix.go +++ b/src/net/dnsclient_unix.go @@ -57,11 +57,14 @@ func newRequest(q dnsmessage.Question) (id uint16, udpReq, tcpReq []byte, err er return 0, nil, nil, err } tcpReq, err = b.Finish() + if err != nil { + return 0, nil, nil, err + } udpReq = tcpReq[2:] l := len(tcpReq) - 2 tcpReq[0] = byte(l >> 8) tcpReq[1] = byte(l) - return id, udpReq, tcpReq, err + return id, udpReq, tcpReq, nil } func checkResponse(reqID uint16, reqQues dnsmessage.Question, respHdr dnsmessage.Header, respQues dnsmessage.Question) bool {