From 86312a4732a0feb66b530adac281afa07580a142 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Wed, 6 Feb 2019 23:30:28 +0000 Subject: [PATCH] Fix go-vet issue This fix fixes the following issue with `go vet`: ``` $ go tool vet cmd/dockerd/daemon.go cmd/dockerd/daemon.go:163: the cancel function is not used on all paths (possible context leak) cmd/dockerd/daemon.go:167: this return statement may be reached without using the cancel var defined on line 163 ``` Signed-off-by: Yong Tang --- cmd/dockerd/daemon.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/dockerd/daemon.go b/cmd/dockerd/daemon.go index f61246d5c6..2d9f0b8b3e 100644 --- a/cmd/dockerd/daemon.go +++ b/cmd/dockerd/daemon.go @@ -164,6 +164,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) { if cli.Config.ContainerdAddr == "" && runtime.GOOS != "windows" { systemContainerdAddr, ok, err := systemContainerdRunning(cli.Config.IsRootless()) if err != nil { + cancel() return errors.Wrap(err, "could not determine whether the system containerd is running") } if !ok {