-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Description
f, err := os.OpenFile(c.LogPath(), os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0600)
If the r.task.Create() call fails on line 135, the file would be unclosed.
Steps to reproduce the issue:
1.
2.
3.
Describe the results you received:
Describe the results you expected:
Potential fix:
diff --git a/internal/oci/runtime_vm.go b/internal/oci/runtime_vm.go
index b4c500b40..981e7e223 100644
--- a/internal/oci/runtime_vm.go
+++ b/internal/oci/runtime_vm.go
@@ -141,6 +141,7 @@ func (r *runtimeVM) CreateContainer(c *Container, cgroupParent string) (err erro
select {
case err = <-createdCh:
+ f.Close()
if err != nil {
return errors.Errorf("CreateContainer failed: %v", err)
}
Additional information you deem important (e.g. issue happens only occasionally):
Output of crio --version:
Metadata
Metadata
Assignees
Labels
No labels