summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-08-24 03:50:56 -0400
committerGitHub <noreply@github.com>2021-08-24 03:50:56 -0400
commiteb9d731c68266cd0953b0669f2bc6340aa8df288 (patch)
tree8b9f83168bfcdac85572b2ea49dc711547a5aa85
parentd1137664fe799bb9ca84ed9e4e0d01db6df77bad (diff)
parent02e59c6683d645bd579d01f4cf6efb3647d366a5 (diff)
downloadpodman-eb9d731c68266cd0953b0669f2bc6340aa8df288.tar.gz
podman-eb9d731c68266cd0953b0669f2bc6340aa8df288.tar.bz2
podman-eb9d731c68266cd0953b0669f2bc6340aa8df288.zip
Merge pull request #11313 from nalind/leaked-bus-connection
utils.RunUnderSystemdScope(): always close Conn
-rw-r--r--utils/utils_supported.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/utils_supported.go b/utils/utils_supported.go
index 8668e3fba..ebc870d26 100644
--- a/utils/utils_supported.go
+++ b/utils/utils_supported.go
@@ -36,6 +36,7 @@ func RunUnderSystemdScope(pid int, slice string, unitName string) error {
return err
}
}
+ defer conn.Close()
properties = append(properties, systemdDbus.PropSlice(slice))
properties = append(properties, newProp("PIDs", []uint32{uint32(pid)}))
properties = append(properties, newProp("Delegate", true))
@@ -54,7 +55,6 @@ func RunUnderSystemdScope(pid int, slice string, unitName string) error {
}
return err
}
- defer conn.Close()
// Block until job is started
<-ch