diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-05-14 10:38:21 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-05-14 10:38:21 -0400 |
commit | 7b4f6f573dd1b583b58c45cfef93c00ee3581051 (patch) | |
tree | 541d29cc77a5399713aa86b26a364bedaeff9b1a /libpod/runtime_pod_linux.go | |
parent | a261b60cc8851c04efd191be6f6e2e4598439822 (diff) | |
download | podman-7b4f6f573dd1b583b58c45cfef93c00ee3581051.tar.gz podman-7b4f6f573dd1b583b58c45cfef93c00ee3581051.tar.bz2 podman-7b4f6f573dd1b583b58c45cfef93c00ee3581051.zip |
When removing pods, free their locks
Without this we leak allocated locks, which is definitely not a
good thing.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r-- | libpod/runtime_pod_linux.go | 10 |
1 files changed, 10 insertions, 0 deletions
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 } |