Avoid a memory leak with Service Containers

This commit is contained in:
Pieter van de Bruggen 2019-07-27 11:06:20 -07:00 committed by GitHub
parent 3ac4b90e8f
commit 9d09a5fe4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -267,6 +267,7 @@ func (c *DockerCommand) assignContainersToServices(containers []*Container, serv
// Index Services by name.
serviceMap := make(map[string]*Service)
for _, service := range services {
service.Containers = make([]*Container, 0, 1)
serviceMap[service.Name] = service
}