Merge pull request #550 from LK4D4/fix_panic

Check for cmd.Process not-nilness in setnsProcess.terminate()
This commit is contained in:
Mrunal Patel 2015-04-22 11:40:34 -07:00
commit c32142a807
1 changed files with 3 additions and 0 deletions

View File

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