From d7aab179c16fc6715a0d0426054c01c236a68aa4 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Wed, 22 Apr 2015 11:30:42 -0700 Subject: [PATCH] Check for cmd.Process not-nilness in setnsProcess.terminate() We already doing this in initProcess Signed-off-by: Alexander Morozov --- process_linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/process_linux.go b/process_linux.go index 1c74b654..66411a8a 100644 --- a/process_linux.go +++ b/process_linux.go @@ -119,6 +119,9 @@ func (p *setnsProcess) execSetns() error { // terminate sends a SIGKILL to the forked process for the setns routine then waits to // avoid the process becomming a zombie. func (p *setnsProcess) terminate() error { + if p.cmd.Process == nil { + return nil + } err := p.cmd.Process.Kill() if _, werr := p.wait(); err == nil { err = werr