1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Add lock before accessing native driver active containers

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca 2015-05-26 13:54:53 +02:00
parent 77280a87b7
commit 9e425d56d0

View file

@ -259,7 +259,9 @@ func (d *driver) Kill(c *execdriver.Command, sig int) error {
}
func (d *driver) Pause(c *execdriver.Command) error {
d.Lock()
active := d.activeContainers[c.ID]
d.Unlock()
if active == nil {
return fmt.Errorf("active container for %s does not exist", c.ID)
}
@ -267,7 +269,9 @@ func (d *driver) Pause(c *execdriver.Command) error {
}
func (d *driver) Unpause(c *execdriver.Command) error {
d.Lock()
active := d.activeContainers[c.ID]
d.Unlock()
if active == nil {
return fmt.Errorf("active container for %s does not exist", c.ID)
}