From 3134161be3f578ff009673786684b3abbe9abb3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sima=CC=83o=20Reis?= Date: Wed, 30 Jan 2019 12:41:54 -0100 Subject: [PATCH] Fix nil pointer derefence on failure to connect to containerd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simão Reis --- libcontainerd/supervisor/remote_daemon.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainerd/supervisor/remote_daemon.go b/libcontainerd/supervisor/remote_daemon.go index 2acca6f33f..31b93f11f0 100644 --- a/libcontainerd/supervisor/remote_daemon.go +++ b/libcontainerd/supervisor/remote_daemon.go @@ -311,6 +311,8 @@ func (r *remote) monitorDaemon(ctx context.Context) { delay = time.After(time.Duration(transientFailureCount) * 200 * time.Millisecond) continue } + client.Close() + client = nil } if system.IsProcessAlive(r.daemonPid) { @@ -318,8 +320,6 @@ func (r *remote) monitorDaemon(ctx context.Context) { r.killDaemon() } - client.Close() - client = nil r.daemonPid = -1 delay = nil transientFailureCount = 0