From 85cd6dcc6957d0d62b0655edba35a4ac66dff08e 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 f86287f..dd3c314 100644 --- a/main.go +++ b/main.go @@ -724,8 +724,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() + }() } pathsToLocksWithParseAs, errored := findAllLockfiles(r, cli.Args(), *parseAs, img)