From 7b4f6f573dd1b583b58c45cfef93c00ee3581051 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 14 May 2019 10:38:21 -0400 Subject: When removing pods, free their locks Without this we leak allocated locks, which is definitely not a good thing. Signed-off-by: Matthew Heon --- libpod/runtime_pod_linux.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libpod/runtime_pod_linux.go') diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index 456ad365f..124d0daf8 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -308,5 +308,15 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) // Mark pod invalid p.valid = false p.newPodEvent(events.Remove) + + // Deallocate the pod lock + if err := p.lock.Free(); err != nil { + if removalErr == nil { + removalErr = errors.Wrapf(err, "error freeing pod %s lock", p.ID()) + } else { + logrus.Errorf("Error freeing pod %s lock: %v", p.ID(), err) + } + } + return removalErr } -- cgit v1.2.3-54-g00ecf