Fix nil pointer derefence on failure to connect to containerd
Signed-off-by: Simão Reis <smnrsti@gmail.com>
(cherry picked from commit 3134161be3
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2e4c5c57c3
commit
0841c61862
1 changed files with 2 additions and 2 deletions
|
@ -311,6 +311,8 @@ func (r *remote) monitorDaemon(ctx context.Context) {
|
||||||
delay = time.After(time.Duration(transientFailureCount) * 200 * time.Millisecond)
|
delay = time.After(time.Duration(transientFailureCount) * 200 * time.Millisecond)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
client.Close()
|
||||||
|
client = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if system.IsProcessAlive(r.daemonPid) {
|
if system.IsProcessAlive(r.daemonPid) {
|
||||||
|
@ -318,8 +320,6 @@ func (r *remote) monitorDaemon(ctx context.Context) {
|
||||||
r.killDaemon()
|
r.killDaemon()
|
||||||
}
|
}
|
||||||
|
|
||||||
client.Close()
|
|
||||||
client = nil
|
|
||||||
r.daemonPid = -1
|
r.daemonPid = -1
|
||||||
delay = nil
|
delay = nil
|
||||||
transientFailureCount = 0
|
transientFailureCount = 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue