Explorar el Código

Fix nil pointer derefence on failure to connect to containerd

Signed-off-by: Simão Reis <smnrsti@gmail.com>
Simão Reis hace 6 años
padre
commit
3134161be3
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      libcontainerd/supervisor/remote_daemon.go

+ 2 - 2
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