From 120660e239731fe62246848ff03b5423eeb5bbf1 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Thu, 18 Apr 2024 09:29:05 +0800 Subject: [PATCH] fix: close resource file Signed-off-by: guoguangwu --- libpod/oci_conmon_common.go | 1 + 1 file changed, 1 insertion(+) diff --git a/libpod/oci_conmon_common.go b/libpod/oci_conmon_common.go index 3bff76adec..548286af0f 100644 --- a/libpod/oci_conmon_common.go +++ b/libpod/oci_conmon_common.go @@ -342,6 +342,7 @@ func generateResourceFile(res *spec.LinuxResources) (string, []string, error) { if err != nil { return "", nil, err } + defer f.Close() j, err := json.Marshal(res) if err != nil {