mirror of
https://github.com/containers/podman.git
synced 2025-06-23 18:59:30 +08:00
Merge pull request #17695 from dfr/freebsd-cleanup
libpod: avoid nil pointer dereference in (*Container).Cleanup
This commit is contained in:
@ -788,10 +788,12 @@ func (c *Container) Cleanup(ctx context.Context) error {
|
|||||||
|
|
||||||
// make sure all the container processes are terminated if we are running without a pid namespace.
|
// make sure all the container processes are terminated if we are running without a pid namespace.
|
||||||
hasPidNs := false
|
hasPidNs := false
|
||||||
for _, i := range c.config.Spec.Linux.Namespaces {
|
if c.config.Spec.Linux != nil {
|
||||||
if i.Type == spec.PIDNamespace {
|
for _, i := range c.config.Spec.Linux.Namespaces {
|
||||||
hasPidNs = true
|
if i.Type == spec.PIDNamespace {
|
||||||
break
|
hasPidNs = true
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !hasPidNs {
|
if !hasPidNs {
|
||||||
|
Reference in New Issue
Block a user