Fix nil pointer derefence on failure to connect to containerd
Signed-off-by: Simão Reis <smnrsti@gmail.com> (cherry picked from commit 3134161be3f578ff009673786684b3abbe9abb3f) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 0841c61862e66c47ec735ad9de0039b806de37aa Component: engine
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
c835df1d14
commit
8af9b67ca8
@ -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
|
||||
|
||||
Reference in New Issue
Block a user