mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Check for cmd.Process not-nilness in setnsProcess.terminate()
We already doing this in initProcess Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user