summaryrefslogtreecommitdiff
path: root/libpod/runtime_ctr.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r--libpod/runtime_ctr.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index aa91dff03..f0beb0941 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -813,7 +813,7 @@ func (r *Runtime) GetRunningContainers() ([]*Container, error) {
// GetContainersByList is a helper function for GetContainers
// which takes a []string of container IDs or names
func (r *Runtime) GetContainersByList(containers []string) ([]*Container, error) {
- var ctrs []*Container
+ ctrs := make([]*Container, 0, len(containers))
for _, inputContainer := range containers {
ctr, err := r.LookupContainer(inputContainer)
if err != nil {