From 933928ae079db761d33c7e06062fdb0ee9f97dd4 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sun, 26 Feb 2023 12:20:15 +1300 Subject: [PATCH] fix: ensure that images are properly cleaned up See https://github.com/anchore/stereoscope/issues/132 --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index b8728910..7d8291b3 100644 --- a/main.go +++ b/main.go @@ -714,8 +714,10 @@ This flag can be passed multiple times to ignore different vulnerabilities`) return 1 } - // note: we are writing out temp files which should be cleaned up after you're done with the image object - defer img.Cleanup() + defer func() { + stereoscope.Cleanup() + _ = img.Cleanup() + }() } pathsToLocks, errored := findAllLockfiles(r, cli.Args(), *parseAs, img)