mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Merge pull request #11313 from nalind/leaked-bus-connection
utils.RunUnderSystemdScope(): always close Conn
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user