diff --git a/pkg/checkpoint/crutils/checkpoint_restore_utils.go b/pkg/checkpoint/crutils/checkpoint_restore_utils.go index 2ac9f65079..cb9dd6ec1d 100644 --- a/pkg/checkpoint/crutils/checkpoint_restore_utils.go +++ b/pkg/checkpoint/crutils/checkpoint_restore_utils.go @@ -166,6 +166,7 @@ func CRCreateRootFsDiffTar(changes *[]archive.Change, mountPoint, destination st if err != nil { return includeFiles, fmt.Errorf("exporting root file-system diff to %q: %w", rootfsDiffPath, err) } + defer rootfsTar.Close() rootfsDiffFile, err := os.Create(rootfsDiffPath) if err != nil { return includeFiles, fmt.Errorf("creating root file-system diff file %q: %w", rootfsDiffPath, err)