aboutsummaryrefslogtreecommitdiff
path: root/libpod/oci_internal_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-01 09:03:44 -0700
committerGitHub <noreply@github.com>2019-10-01 09:03:44 -0700
commit7a5696316a03df5dddded9c3afa8bf26acd74678 (patch)
tree466277b936d314f23fba2eb44d0d9a446f9a4508 /libpod/oci_internal_linux.go
parent4fe49f5840025bc971793d1be747f0ecd9f7cc24 (diff)
parentec940b08c6149d91cf969cb9b56299058c739735 (diff)
downloadpodman-7a5696316a03df5dddded9c3afa8bf26acd74678.tar.gz
podman-7a5696316a03df5dddded9c3afa8bf26acd74678.tar.bz2
podman-7a5696316a03df5dddded9c3afa8bf26acd74678.zip
Merge pull request #4139 from giuseppe/fix-segfault-missing-slirp4netns
networking: fix segfault when slirp4netns is missing
Diffstat (limited to 'libpod/oci_internal_linux.go')
-rw-r--r--libpod/oci_internal_linux.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/libpod/oci_internal_linux.go b/libpod/oci_internal_linux.go
index a5cce795b..437b7cf4d 100644
--- a/libpod/oci_internal_linux.go
+++ b/libpod/oci_internal_linux.go
@@ -137,8 +137,12 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Containe
return errors.Wrapf(err, "failed to create rootless network sync pipe")
}
} else {
- defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncR)
- defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncW)
+ if ctr.rootlessSlirpSyncR != nil {
+ defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncR)
+ }
+ if ctr.rootlessSlirpSyncW != nil {
+ defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncW)
+ }
}
// Leak one end in conmon, the other one will be leaked into slirp4netns
cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.rootlessSlirpSyncW)