Merge pull request #38653 from sreis/38636-fix-nil-pointer-dereference

Fix nil pointer derefence on failure to connect to containerd
This commit is contained in:
Sebastiaan van Stijn 2019-01-31 13:38:31 +01:00 committed by GitHub
commit 22e4f12e5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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